This is a part of tutorial series about sending email in PHP. We know, many different type of email get sent. Email can contains file attachments, inline images, dual format (HTML/text), and so on. We begin with simple email. It use basic function, mail().
To understand how to send a simple email, you can look following code:
03 | date_default_timezone_set( 'America/New_York' ); |
06 | $to = 'example@phpeveryday.com' ; |
07 | $subject = 'Test Text Email Only' ; |
11 | $headers = "From: me@mysite.com\r\nX-Mailer: Custom PHP Script" ; |
14 | $body = "Hi.\n\nHello World!\n\nRegards,\n\nWiwit." ; |
17 | mail( $to , $subject , $body , $headers ); |
0 comments:
Post a Comment