LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 11-19-2018, 12:46 AM   #1
asher!23
LQ Newbie
 
Registered: Nov 2018
Posts: 2

Rep: Reputation: Disabled
CentOS Server send mail Timeout


We have purchased a shared hosting with CentOS installed. we are trying to send mail in centos server, It gives error connection time out.
we are trying to send mail using phpmailer library and using this smptp "smtp.office365.com" with port 587 but every time it is returning the same error.
We have tried different smtp yahoo and gmail but its not working.

When we have run this command "telnet smtp.office365.com 587" it is returning connection timeout.
 
Old 11-19-2018, 01:58 AM   #2
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,163
Blog Entries: 1

Rep: Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032
Hi and welcome to LQ,

Quote:
When we have run this command "telnet smtp.office365.com 587" it is returning connection timeout.
It works from here, so that means that outgoing port 587 is closed by your provider.
You should ask them for support

Regards
 
Old 11-19-2018, 05:50 AM   #3
asher!23
LQ Newbie
 
Registered: Nov 2018
Posts: 2

Original Poster
Rep: Reputation: Disabled
Hello Bathory,
How will we know that 587 is closed or open?
 
Old 11-19-2018, 07:06 AM   #4
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,163
Blog Entries: 1

Rep: Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032
Quote:
Originally Posted by asher!23 View Post
Hello Bathory,
How will we know that 587 is closed or open?
If you can't connect to a remote server on port 587, while you know that this port is publicly open, that means the port in question is closed.
Try "telnet smtp.gmail.com 587" to verify with another server also known to accept connections on that port.
FYI I can connect to both servers on port 587 from here...
 
Old 11-19-2018, 07:08 AM   #5
dc.901
Senior Member
 
Registered: Aug 2018
Location: Atlanta, GA - USA
Distribution: CentOS/RHEL, openSuSE/SLES, Ubuntu
Posts: 1,005

Rep: Reputation: 370Reputation: 370Reputation: 370Reputation: 370
Quote:
Originally Posted by asher!23 View Post
Hello Bathory,
How will we know that 587 is closed or open?
That's what telnet command is telling you.

Try this; capture output of telnet command from the hosted server where it times out. Then capture output of same telnet command from your personal machine or another machine that is not on same hosted providers network, then contact the provider with both captured output.

Additionally, do you have to use the office365 to send emails?

From your CentOS machine, you can use mail command:
Code:
echo "test email from centos machine" | mail -s Subject -r replytoemail@yourdomain.com  your_valid_email@yourdomain.com
 
Old 11-19-2018, 08:51 AM   #6
scasey
LQ Veteran
 
Registered: Feb 2013
Location: Tucson, AZ, USA
Distribution: CentOS 7.9.2009
Posts: 5,733

Rep: Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212
Quote:
Originally Posted by dc.901 View Post
Additionally, do you have to use the office365 to send emails?

From your CentOS machine, you can use mail command:
Code:
echo "test email from centos machine" | mail -s Subject -r replytoemail@yourdomain.com  your_valid_email@yourdomain.com
Note: That will only work if there is a properly configure mail server running on the host. Certainly that may be the case, but it's not a given.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
LAN mail clients cannot send mail (receiving mail is working) rnturn Linux - Server 2 07-22-2015 11:53 PM
can mail command be used to send mail onto global mail servers like yahoo etc dale_chip Linux - Newbie 4 08-12-2008 08:33 AM
Postfix : mail cannot send to send outside ( can send/receive locally) bobbinsupport Linux - Networking 3 12-15-2007 10:40 PM
with the linux proxi, backend pop3 mail client can not receive mail and send mail rubin823 Linux - Networking 0 12-21-2006 10:06 PM
Timeout response from RH/SM mail server from mail client Mordanthanus Linux - Networking 0 05-09-2005 11:16 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 10:27 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration