SMTP authentication code...?? - Programmers Heaven

Howdy, Stranger!

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

Categories

Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

SMTP authentication code...??

DanyDany Posts: 26Member
Hello there,
I have a mail() function that only sends mail to it's own domain, and I was told I need to put SMTP authentication code in there in order to send code outside of the domain... what is this and how do I do it??
Thank you!!
Dany

Comments

  • SouldrinkerSouldrinker Posts: 143Member
    : Hello there,
    : I have a mail() function that only sends mail to it's own domain, and I was told I need to put SMTP authentication code in there in order to send code outside of the domain... what is this and how do I do it??
    : Thank you!!
    : Dany
    :

    If you are using the apache webserver and the sendmail mailserver, just add the following code to your virtualhost directive, locating the folder your domain will be pointed to:

    [code]
    php_admin_value sendmail_path "/usr/sbin/sendmail -t -i -f
    [/code]

    Then you must, add a additional variable to your mail() call:

    [code]
    "-f[adress of your sender"
    [/code]

    the "-f" command, will be sent to the sendmail mailserver, to ensure the sender of your mail. For more details see: http://de3.php.net/manual/de/function.mail.php

    If you don't do this, the procedure will be runned as follow:

    [code]
    php contacts the mailserver
    php sends the mailheaders (From: / To: ...)
    sendmail adds the mailheaders
    sendmail sends the mail and the data
    [/code]

    In this procedure, no one indicates the [b]real sender[/b]! Only the "From:" Header is sent to the mailserver, and the mailserver will send the mail, using an auto generated adress from the user, the webserver runs as, and the local host name, for example, this adress could be "[email protected]". Such a mail will never get through the next relay, it's sent to.
Sign In or Register to comment.