note 57095 added to function.imap-mail-compose
| From: | hans at lintoo dot dk | Date: | Fri, 23 Sep 2005 13:29:37 +0000 |
| Subject: | note 57095 added to function.imap-mail-compose | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-95658@lists.php.net to get a copy of this message | ||
I got a lot of problems with attachments (multipart emails) and the fix directly below this note.
instead just include it in the optional headers argument as previously suggested:
<?php
$mail = str_replace("\r","",imap_mail_compose($envelope, $body));
imap_mail($_POST["to"],$_POST["subject"],'',$mail);
?>
"Nothing like a fix on a fix".
If you want to copy the message to ie: a sent folder do:
<?php
//take note of the link: $this->mbox, and the constant: self::$imapStream
$envelope["to"] = $_POST["to"]; //included with imap_mail
$envelope["subject"] = $_POST["subject"]; //included with imap_mail
$mail = imap_mail_compose($envelope, $body); //note no problems with \r
imap_append($this->mbox,self::$imapStream."INBOX.Sent",$mail ,"\\Seen");
?>
See imap_append for more info.... Enjoy!
----
Manual Page -- http://www.php.net/manual/en/function.imap-mail-compose.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+57095
Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+57095&report=yes&reason=added+to+the+manual
Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+57095&report=yes&reason=bad+code
Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+57095&report=yes&reason=spam
Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+57095&report=yes&reason=useless
Delete: non-english -- http://master.php.net/manage/user-notes.php?action=delete+57095&report=yes&reason=non-english
Delete: already in docs -- http://master.php.net/manage/user-notes.php?action=delete+57095&report=yes&reason=already+in+docs
Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+57095&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+57095&report=yes
Search -- http://master.php.net/manage/user-notes.php