Faqts : Computers : Programming : Languages : PHP : Common Problems : Email

+ Search
Add Entry AlertManage Folder Edit Entry Add page to http://del.icio.us/
Did You Find This Entry Useful?

9 of 16 people (56%) answered Yes
Recently 5 of 10 people (50%) answered Yes


Is there a way to redirect mail to be sent thru another mail server when using mail()? ini_set()?

Jul 5th, 2001 09:23
Jonathan Sharp, Amos Chan, Ben Udall,

mail() uses whatever program you have specified in your php.ini file. 
As far as relaying mail or using a different server to send mail, that 
isn't possible with the mail() function. Your best bet would be to 
write a class that would open a socket to the mail server you want to 
relay mail through, and send your message that way. The SMTP commands 
you would need are in RFC-821 (http://www.freesoft.org/CIE/RFC/821/)