note 45758 deleted from function.mail by sniper
| From: | sniper@php.net | Date: | Wed, 19 Jan 2005 14:35:08 +0000 |
| Subject: | note 45758 deleted from function.mail by sniper | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-83627@lists.php.net to get a copy of this message | ||
Note Submitter: webmaster at ogmiosproject dot org
----
I have encountered some problems using both the "to" parameter of the mail() function and
filling in the "To: " field in the header.
I don't know if this is due to my PHP version (4.3.8) or my e-mail program (Microsoft Outlook
9.0.0.2814) which doesn't read the SMTP message it recieves properly.
Anyway, to avoid this, I simply do not fill in the "to" paramter and leave the header to
do all the wotk:
<?php
$headers = "MIME-Version: 1.0\\r\\n" .
"Content-type: text/html; charset=WINDOWS-1255\\r\\n" .
"To: Some Target <target@somemail.com>\\r\\n" .
"From: Some Source <source@somemail.com>\\r\\n";
$message = "Hello World";
$subject = "Some Subject";
mail(null, $subject, $message, $headers);
?>
Hope this helps someone.