using a remote SMTP server to send mail (PHP)

My php script is in a intranet server, but I need to be able to send mail to anyone. To do this i need to send mail through a remote mail server. I configured the php.ini file as follows:

SMTP = remoteMailServer_Addr

and tryed commenting, and uncommenting the following:

sendmail_from = address@remoteMailServer
sendmail_path = /usr/sbin/sendmail -i -t

For some reason it will not use the remote Mail server to send the emails (even when i comment the sendmail stuff). Can anyone give me a hint as to what is going on.

Comments

  • I bet your webserver is Unix. What you're trying to do only works with Windows server. Check the PHP manual. Forget the PHP function mail(), it is full of bugs and doesn't work as they say. Instead use custom function to send mail. For a multiplatform solution, use a package such as phpmailer (http://phpmailer.sourceforge.net/). That package can handle multiple SMTP servers, sendmail, or mail(). Besides it is easier to use than mail() and is more customizable. I hope this helps...

    orosado

    : My php script is in a intranet server, but I need to be able to send mail to anyone. To do this i need to send mail through a remote mail server. I configured the php.ini file as follows:
    :
    : SMTP = remoteMailServer_Addr
    :
    : and tryed commenting, and uncommenting the following:
    :
    : sendmail_from = address@remoteMailServer
    : sendmail_path = /usr/sbin/sendmail -i -t
    :
    : For some reason it will not use the remote Mail server to send the emails (even when i comment the sendmail stuff). Can anyone give me a hint as to what is going on.
    :

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

In this Discussion