Send e-mail not working

Problems with the Windows version of XAMPP, questions, comments, and anything related.

Send e-mail not working

Postby mickeymouse » 27. March 2012 21:45

I want to send an e-mail to my user but it's not working.
I believe it's an installation problem but that's all I know.

My code is:
mail($to,$subject,$message,$headers); //this is line 73
and I'm sure my parameters are correct.

The msg I get is:
Warning: mail() [function.mail]: Failed to connect to mailserver at "localhost" port 25, verify your "SMTP" and "smtp_port" setting in php.ini or use ini_set() in C:\xampp\htdocs\Annuaire\AF_Forgot.php on line 73

Thanks for your help
Mickey
mickeymouse
 
Posts: 42
Joined: 08. March 2009 06:10
Location: France & Canada
Operating System: Win 7 Family Prem Ed (64 bit?)

Re: Send e-mail not working

Postby Sharley » 27. March 2012 22:22

See if your solution is within these forum search results for sendmail solved

Or in these for sendmail without the solved added.

Good luck. :)
User avatar
Sharley
AF Moderator
 
Posts: 3316
Joined: 03. October 2008 05:10
Location: Yeppoon, Australia Time Zone: GMT/UTC+10
Operating System: Win 7 Pro 32bit/XP Pro SP3

Re: Send e-mail not working

Postby mickeymouse » 28. March 2012 19:47

I changes my XAMPP to version 1.7.7 and now, when I try to send an e-mail, I get:

Warning: mail() [function.mail]: SMTP server response: 553 We do not relay non-local mail, sorry. in C:\xampp\htdocs\Annuaire\AF_Forgot.php on line 73

What does this mean "non-local mail".

I'm trying to test my code to see if the message get through by sending the e-mail to my own hotmail.com box.

Thanks
mickeymouse
 
Posts: 42
Joined: 08. March 2009 06:10
Location: France & Canada
Operating System: Win 7 Family Prem Ed (64 bit?)

Re: Send e-mail not working

Postby Sharley » 28. March 2012 23:14

Without knowing if you installed the latest sendmail, found in the above search results for 1.7.7 or how you have configured the sendmail.ini file and the php.ini file, then it will be impossible to answer your question effectively.
You can obfuscate any sensitive data you don't want made public on the forum.

Please read this forum announcement:
viewtopic.php?f=16&t=48331
Thanks. :)
User avatar
Sharley
AF Moderator
 
Posts: 3316
Joined: 03. October 2008 05:10
Location: Yeppoon, Australia Time Zone: GMT/UTC+10
Operating System: Win 7 Pro 32bit/XP Pro SP3

Re: Send e-mail not working

Postby mickeymouse » 30. March 2012 12:11

The Forum Announcment you refer me to askes that I inform you as to which Control Panel version I'm using. It is 2.5 (which came with my downloading of XAMPP 1.7.7) My profile is up to date but there is no place for me to show this CP version.

Concerning my e-mail sending problem, you say "Without knowing if you installed the latest sendmail..." I simply downdloaded XAMPP V1.7.7. I didn't do anything for "sendmail"; there were no options for me to select, it is whatever came with the download and I presume it would be the latest. As for configuring sendmail.ini and php.ini files, I didn't do anything there either. I wasn't aware that I should. If I am, I have absolutly no idea of what/how I should configure. I have read both files. Neither of them seem to have much relevant to sending mail. All I could find (in PHP.ini) was
SMTP = localhost
smtp_port = 25
I'm not having problems with the port, so no need to change that and for SMTP, I can only assume that 'localhost' is correct
and since I have absolutly no idea what is done with this, I can't figure out what else it should be.

I have read the POSTS you refer me to but none of them address this problem/message which I'm getting, i.e., 'We do not relay non-local mail'.

I'll keep working on it but your assistance so far and any further assistance is greatly appreciated.
mickeymouse
 
Posts: 42
Joined: 08. March 2009 06:10
Location: France & Canada
Operating System: Win 7 Family Prem Ed (64 bit?)

Re: Send e-mail not working

Postby DesktopSages » 08. April 2012 16:10

I hope this helps everyone. While attempting to use the mail(); function in PHP I also received the error:

Warning: mail() [function.mail]: SMTP server response: 553 We do not relay non-local mail, sorry.

I fixed it as follows:

1. Open XAMPP Control Panel

2. Click "Admin..." next to Mercury.

3. In the Mercury/32 window click "Configuration"

4. Click "MercuryS SMTP Server".

5. Click the "Connection control" tab.

6. Take the check out of "Do not permit SMTP relaying of non-local mail" and click "OK".

7. Close the "Mercury/32" window and run your script again.

That should do it.
DesktopSages
 
Posts: 1
Joined: 08. April 2012 16:03
Operating System: Windows 7

Re: Send e-mail not working

Postby mickeymouse » 19. April 2012 23:22

Thanks DesktopSage.
I tried it and it does get rid of the 'non relaying of local mail' message but it doesn't send the e-mail;
at least, the recipient (me) does not get the e-mail.
mickeymouse
 
Posts: 42
Joined: 08. March 2009 06:10
Location: France & Canada
Operating System: Win 7 Family Prem Ed (64 bit?)

Re: Send e-mail not working

Postby Hamish » 21. April 2012 12:11

I have exactly the same problem. Did you finally get an answer?

'H'
Hamish
 
Posts: 15
Joined: 18. June 2011 21:21
Operating System: Windows 7

Re: Send e-mail not working

Postby mickeymouse » 24. April 2012 21:42

My dear Hamish,
So sorry. i didn't get an answer. I guess no one knows the answer.
But I haven't given up so keep checking this item.
Mickey
mickeymouse
 
Posts: 42
Joined: 08. March 2009 06:10
Location: France & Canada
Operating System: Win 7 Family Prem Ed (64 bit?)

Re: Send e-mail not working

Postby Hamish » 26. April 2012 21:42

Mickey,

See my post on this subject (re sending email using php) - it may help. If it does - super.

Regards,

'H'
Hamish
 
Posts: 15
Joined: 18. June 2011 21:21
Operating System: Windows 7

Re: Send e-mail not working

Postby Hamish » 26. April 2012 21:44

Mickey,

Sorry - wrong post: it should be 'Debugging email connection@. That should see you right.

'H'
Hamish
 
Posts: 15
Joined: 18. June 2011 21:21
Operating System: Windows 7

Re: Send e-mail not working

Postby mickeymouse » 30. April 2012 13:53

I changed my php.ini and sendmail.ini to exactly what you have in Debugging email connection@.
I also set up error.log and debug.log in same folder as sendemail.exe
I used your same send mail code, i.e.,

<?php
$email_to = "my_email_address_here";
$name="Harry";
$email="my_email_address_here";
$phone="0247123456";
$email_subject = 'Feedback from website';
$headers = 'From: me@there.com\r\n';
$message='Name: ' .$name. "\r\n". 'Email: ' .$email. "\r\n". 'Phone: ' .$phone;
$sent = mail($email_to, $email_subject, $message, $headers);
if($sent)
{print "Your mail was sent successfully to $email_to"; }
else
{print "We encountered an error sending your mail"; }
?>

The result is the same as I had before - I get the message that the email was successfully sent but the email is never actually sent or at least it is never received by the $email_to addressee.
Also, i get no error messages in any of the logs, actually no message at all.

Thankfull (& frustrated),
Mickey
mickeymouse
 
Posts: 42
Joined: 08. March 2009 06:10
Location: France & Canada
Operating System: Win 7 Family Prem Ed (64 bit?)


Return to XAMPP for Windows

Who is online

Users browsing this forum: No registered users and 70 guests