sending mail from linux using external mail server

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
phpBever
Forum Commoner
Posts: 42
Joined: Fri Aug 07, 2009 10:23 am

sending mail from linux using external mail server

Post by phpBever »

My reading suggests that with a Windows installation one can indicate an SMTP server that is not on the local host. But it seems to imply that from a Linux installation one needs to use a locally running sendmail. Is there any way I can use the mail() function and have the mail sent from my SMTP server where my domain is hosted (and where my Evolution mail gets sent from)? I haven't seen any indication of how to do that. I've tried to set up my php.ini following the Windows model, but that doesn't seem to work.

Thanks.
User avatar
flying_circus
Forum Regular
Posts: 732
Joined: Wed Mar 05, 2008 10:23 pm
Location: Sunriver, OR

Re: sending mail from linux using external mail server

Post by flying_circus »

I had this same problem a month or two ago. You can reach your goal, but not with mail(). There are pure PHP solutions to use external SMTP server's that also allow you to use authentication as well. The solution I ended up using was Swift Mailer.
phpBever
Forum Commoner
Posts: 42
Joined: Fri Aug 07, 2009 10:23 am

Re: sending mail from linux using external mail server

Post by phpBever »

Looks promising. Thanks. My hosted server for production probably won't have this problem but I like to be able to test things locally on my own box.
Post Reply