PROPOSAL: another send function for Mail_smtp
| From: | Vlad Krupin | Date: | Wed, 16 Jan 2002 00:39:04 +0000 |
| Subject: | PROPOSAL: another send function for Mail_smtp | ||
| Groups: | php.pear.dev | ||
| Request: | Send a blank email to pear-dev+get-3950@lists.php.net to get a copy of this message | ||
Hi,
SUMMARY:
I implemented a new function for Mail_smtp class that will allow it to use the output of imap_mail_compose() without modifications to send mail. I ask you for your feedback on whether such a feature will be appropriate. Comments/objections/discussion are welcome.
REASON FOR YET-ANOTHER-FEATURE:
imap_mail_compose() is a very useufl function that generates a full MIME-formatted message. It would be nice to take that output and feed it to a function in Mail_smtp class to send it out. However, Mail_smtp::send() function expects the message envelope separate from the body, and imap_mail_compose() sends them together. Of course, we can split the output of imap_mail_compose() at the place where we meet the first two newlines, and send the first half as the envelope, and the second - as the body. However, this seems silly because Mail_smtp::send() will do some processing on the envelope that imap_mail_compose() has already taken care of, and after that will simply merge the envelope and the body, which is also something that imap_mail_compose() has already done.
PROPOSAL:
Implement a new function, with prototype, say,
bool Mail_smtp::send_fully_composed($recipients, $from, $body); //(couldn't come up with a better name)
which will operate identically to Mail_smtp::send() except will accept the whole MIME-formatted message created by imap_mail_compose() instead of two separate parts - envelope and body.
I have implemented just that - the function is very straightforward and only about 20 lines long.
REQUEST FOR COMMENTS:
I would like to see what kind of feedback/suggestions I can get from you. If you think this is a reasonable and useful addition, I will commit it to CVS (or post a diff on the list, if you prefer that). Please, cc: any responses to me because I am not subscribed to pear-dev.
Thanks,
Vlad Krupin