To understand how to send a simple email, you can look following code:
|
02 | // Setting a timezone, mail() uses this. |
03 | date_default_timezone_set('America/New_York'); |
04 |
05 | // Set email address destination and subject |
06 | $to = 'example@phpeveryday.com'; |
07 | $subject = 'Test Text Email Only'; |
08 | |
09 | // Define the headers we want passed. |
10 | //Note that they are separated by \r\n |
11 | $headers = "From: me@mysite.com\r\nX-Mailer: Custom PHP Script"; |
12 | |
13 | // Your message here: |
14 | $body = "Hi.\n\nHello World!\n\nRegards,\n\nWiwit."; |
15 | |
16 | // Finally, send the email |
17 | mail($to, $subject, $body, $headers); |
18 | ?> |
No comments:
Post a Comment