Page 1 of 1

Help! Sendmail isn't working...

PostPosted: 29. July 2008 14:03
by MissDemeanor
I've searched the forums, and, for some reason, the threads that appear to possibly be the most helpful, have been edited so that the content is not viewable... It would be great if there was a total step-by-step "this is how you do it" somewhere...

In any event, I'm trying to get sendmail to work, but it's not... I get the following error:

Code: Select all
Warning: mail() [function.mail]: Failed to connect to mailserver at "localhost" port 25, verify your "SMTP" and "smtp_port" setting in php.ini


In my sendmail.ini file:

Code: Select all
smtp_server=smtp.spamarrest.com
smtp_port=25
auth_username=myname
auth_password=mypassword
pop3_server=mail.spamarrest.com
pop3_username=myname
pop3_password=mypassword


In my php.ini file:
Code: Select all
SMTP = smtp.spamarrest.com
smtp_port = 25
sendmail_from = myname@spamarrest.com


I've restarted apache, and attempted a very simple mail script:

Code: Select all
$email = 'myemail@yahoo.com';
      $from = "From: My Name <myname@spamarrest.com>";
            $subject = "it worked";
           $body =    'awesome';
        
        if(mail($email,$subject,$body,$from)) { echo 'mail sent'; } else { echo 'mail failed'; }

PostPosted: 29. July 2008 14:12
by Wiedmann
In my php.ini file:

If you want use sendmail, you must enable the line "sendmail_path ..." in "php.ini".

BTW:
- You really need "pop3 before smtp"?
- "force_sender" should be your normal email address.

PostPosted: 29. July 2008 14:32
by MissDemeanor
Thanks for the swift response, but I'm getting the same error.

Now php.ini looks like this:

Code: Select all
[mail function]
; For Win32 only.
SMTP = smtp.spamarrest.com
smtp_port = 25

; For Win32 only.
sendmail_from = myname@spamarrest.com

; For Unix only.  You may supply arguments as well (default: "sendmail -t -i").
sendmail_path = "\xampplite\sendmail\sendmail.exe -t"

; Force the addition of the specified parameters to be passed as extra parameters
; to the sendmail binary. These parameters will always replace the value of
; the 5th parameter to mail(), even in safe mode.
;mail.force_extra_parameters =



And no, I don't need pop3 before SMTP, so I re-commented those lines out in my sendmail.ini file. I also set the force_sender to my normal email address.

But, I'm getting the same error message. Any other suggestions?

PostPosted: 29. July 2008 14:35
by Wiedmann
Now php.ini looks like this:

This is the correct "php.ini"?

(You can verify this with phpinfo()).

PostPosted: 29. July 2008 14:51
by MissDemeanor
Ahhh, that was it. Thanks a million.

PostPosted: 30. July 2008 05:14
by admindell
im geting a error 2, but the smtp server thats in xampp it dont send, it says the mx is bad, and when i enter my dns servers IP it just keeps retrying then it fails