Custom from address/name-not working with SMTP thru Exchange
Posted: Mon May 12, 2008 8:04 am
Hi everyone
I already use SwiftMailer in a couple of small scenarios on various sites I've built... mainly as a safer and easier alternative to PHP's mail function, for sending the results of website forms.
However I'm starting to convert our beast newsletter sending system from PHPMailer to Swift
Using PHPMailer we currently send them using SMTP and have PHPMailer sat on our ISPs free webspace using their SMTP server (I checked with the ISP directly when setting that up and they had no problems with that as a set-up).
Now though I want to speed things up a bit and run it from our intranet Apache server, and sending through our local Exchange SBS 2003 server.
Our Exchange server is configured to then relay all outgoing messages to our ISP's server.
After doing some tests, it's all up and running and works for sending single emails through a dedicated account on our Exchange server. I'm assuming that there won't be any problems with sending batches either.
However I can't seem to customise the From: name in Swift.
Here's the code I use to send a single email:
But when the email arrives in GMail, Outlook or an account in Thunderbird, there is no text in the From: field, just the e-mail address!
However when using Swift on my ISP's server and sending through SMTP/nativemail this works without any problems!
And also when using NativeMail on out intranet, it works perfectly, showing ABC Newsletter [newsletter@abcinc.com] in the From: box in Outlook
So it seems Exchange is stripping this out.
Anyone experienced this with Exchange before, and have any ideas on how to solve it?
Thanks, Ben
I already use SwiftMailer in a couple of small scenarios on various sites I've built... mainly as a safer and easier alternative to PHP's mail function, for sending the results of website forms.
However I'm starting to convert our beast newsletter sending system from PHPMailer to Swift
Using PHPMailer we currently send them using SMTP and have PHPMailer sat on our ISPs free webspace using their SMTP server (I checked with the ISP directly when setting that up and they had no problems with that as a set-up).
Now though I want to speed things up a bit and run it from our intranet Apache server, and sending through our local Exchange SBS 2003 server.
Our Exchange server is configured to then relay all outgoing messages to our ISP's server.
After doing some tests, it's all up and running and works for sending single emails through a dedicated account on our Exchange server. I'm assuming that there won't be any problems with sending batches either.
However I can't seem to customise the From: name in Swift.
Here's the code I use to send a single email:
Code: Select all
$swift->send($message, $email, new Swift_Address('newsletter@abcinc.com', 'ABC Newsletter'));However when using Swift on my ISP's server and sending through SMTP/nativemail this works without any problems!
And also when using NativeMail on out intranet, it works perfectly, showing ABC Newsletter [newsletter@abcinc.com] in the From: box in Outlook
So it seems Exchange is stripping this out.
Anyone experienced this with Exchange before, and have any ideas on how to solve it?
Thanks, Ben