LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   SMTP no error, but no email sent. (https://www.linuxquestions.org/questions/linux-newbie-8/smtp-no-error-but-no-email-sent-933281/)

conflicker 03-07-2012 01:47 PM

SMTP no error, but no email sent.
 
Hi everybody,

I was having a bad time looking for some solution of my server problem. I'am using phpmailer to send mails using smtp server, it gives me no error but no email sent.

When I try my script on other server, and it works. I'm just wondering if there are some webmail configuration that I messed up.

Any idea on things that need to consider to make everything works? Please help. Thanks

ArcLinux 03-07-2012 04:12 PM

What happens when you telnet to the smtp server where the script is not working?
telnet <server> 25

conflicker 03-08-2012 09:20 AM

Quote:

Originally Posted by ArcLinux (Post 4621244)
What happens when you telnet to the smtp server where the script is not working?
telnet <server> 25

Ahhmm.. do I need to install application like telnet on my server or there are some place on the server that I can enable this telnet application. Cause when I try to use this command, it says command not found.

ArcLinux 03-08-2012 09:30 AM

that all depends on your distro.
debian, ubuntu and etc... would probably be: aptget install telnet
redhat, suse and other rpm distros would greatly depend on what you have available and prefered packagemanager.

slackware. it should just be there.

conflicker 03-08-2012 09:36 AM

Quote:

Originally Posted by ArcLinux (Post 4621890)
that all depends on your distro.
debian, ubuntu and etc... would probably be: aptget install telnet
redhat, suse and other rpm distros would greatly depend on what you have available and prefered packagemanager.

slackware. it should just be there.

I'm using CENTOS 6.2, and when I do a google search it gaves me this command to install telnet:
Quote:

yum install telnet*
I just want to confirm if this is the right command. I don't want to messed up with my server due to unsure command.

ArcLinux 03-08-2012 09:37 AM

Quote:

Originally Posted by conflicker (Post 4621896)
I'm using CENTOS 6.2, and when I do a google search it gaves me this command to install telnet:


I just want to confirm if this is the right command. I don't want to messed up with my server due to unsure command.

Looks right to me.

conflicker 03-08-2012 09:44 AM

Quote:

Originally Posted by ArcLinux (Post 4621890)
that all depends on your distro.
debian, ubuntu and etc... would probably be: aptget install telnet
redhat, suse and other rpm distros would greatly depend on what you have available and prefered packagemanager.

slackware. it should just be there.

When I do telnet <host> 25 it says:

Quote:

Connected to hostname.
Escape character is '^]'.
220-ns1.hostname.com ESMTP Exim 4.69 #1 Thu, 08 Mar 2012 10:39:17 -0500
220-We do not authorize the use of this system to transport unsolicited,
220 and/or bulk e-mail.
421 ns1.hostname.com: SMTP command timeout - closing connection
Connection closed by foreign host.
What does it mean?

lithos 03-08-2012 09:52 AM

Quote:

Originally Posted by conflicker (Post 4621903)
When I do telnet <host> 25 it says:

Quote:
Connected to hostname.
Escape character is '^]'.
220-ns1.hostname.com ESMTP Exim 4.69 #1 Thu, 08 Mar 2012 10:39:17 -0500
220-We do not authorize the use of this system to transport unsolicited,
220 and/or bulk e-mail.
421 ns1.hostname.com: SMTP command timeout - closing connection
Connection closed by foreign host.
What does it mean?


What does it mean?

I'm sorry I don't know how to configure, but it shows that your EXIM is not configured for sending or receiving.

But on the other way CentOS 6.x doesn't have Exim configured "out of box" when installed, so someone had to do it.

ArcLinux 03-08-2012 09:59 AM

Quote:

Originally Posted by conflicker (Post 4621903)
When I do telnet <host> 25 it says:

Connected to hostname.
Escape character is '^]'.
220-ns1.hostname.com ESMTP Exim 4.69 #1 Thu, 08 Mar 2012 10:39:17 -0500
220-We do not authorize the use of this system to transport unsolicited,
220 and/or bulk e-mail.
421 ns1.hostname.com: SMTP command timeout - closing connection
Connection closed by foreign host.

What does it mean?

Well it looks like it is working to me. The 220 MOTD for Exim and the 421 is the timeout after waiting and not receiving any input. How long did you have to wait before the prompt timed out?

conflicker 03-08-2012 10:01 AM

Quote:

Originally Posted by ArcLinux (Post 4621917)
Well it looks like it is working to me. The 220 MOTD for Exim and the 421 is the timeout after waiting and not receiving any input. How long did you have to wait before the prompt timed out?

Maybe 1 or 2 mins.

ArcLinux 03-08-2012 10:15 AM

Find yourself a manual online to test smtp from command line. send yourself some mail. if that works we can rule out the smtp server and move on. I am guessing that you will have a setting in the php.ini on the failing web server that will fix it if you find that the smtp server responds correctly.

lithos 03-08-2012 04:50 PM

how to test mail with telnet, another example

good luck

frankbell 03-08-2012 08:38 PM

Are Apache and php configured to send mail from scripts on the server in question?

It might be worth while to compare the php configuration on the server where the script works with that on the server where the script doesn't work and to look for the php error log, wherever it might be located. If php is not sending the mail, the absence of smtp errors would be explained.


All times are GMT -5. The time now is 12:56 AM.