I am trying to send a gmail, here are the commands, using port 587:
EHLO smtp.gmail.com
STARTTLS
AUTH LOGIN
base64_encoded_username
base64_encoded_password
MAIL FROM:<me#gmail.com>
RCPT TO:<other#gmail.com>
DATA
SUBJECT: Hello!
This is the text
QUIT
The server says "Ready to start TLS" What I am doing wrong?
Related
C:\Users\Wild Beast>openssl s_client -starttls smtp -connect smtp.gmail.com:587 CONNECTED(000001B8)
I got connected with the server and was able to login but when I use list command to read the mails. It showed the error
235 2.7.0 Accepted
list
502 5.5.1 Unrecognized command. m7-20020adfe0c7000000b002060e7bbe49sm16301005wri.45 - gsmtp
SMTP on port 587 is used for submitting emails to the outgoing mail server and has no LIST command. You may want to look into POP3 or IMAP to fetch emails from the incoming mail server of your mailbox provider. Let me know if you need help with that.
I have tried connecting and using telnet to a gmail service for testing:
telnet gmail-smtp-in.l.google.com 25
Yet it says
Connecting to gmail-smtp-in.l.google.com failed.. Could not open connection to the host, on port 25: Connect Failed
Is this because of my firewall or am I doing something wrong?
I have tested this at work and at home and I am still unable to telnet in.
Yet, when I do an SMTP test using mxtoolbox, it seems that they can telnet in.
Is there something I am missing?
I am trying to do an SMTP test using Telnet.
Your ISP may be blocking outgoing SMTP connections to smtp (25) port as outgoing spam prevention.
Can you telnet smtp (25) port on any email host beyond your ISP network?
Can you telnet smtp.gamil.com 587?
[Port 587 is intended for client to server SMTP sessions, gmail supports it]
I just purchased a domain name few weeks ago,
and then i registered my domain into Windows Live Admin ( domain.live.com )
because from that Windows Live, I could manage
several email accounts. And I did. now every time I
want to write email / receive email i just go to mail.live.com
and login depend on the email accounts I just made there.
Then I tried to install Opera Mail, or even Thunderbird
in my Computer (laptop).
There are several configuration I confused.
What should I type into the incoming and outcoming server ? Imap / Pop? Which port?
I dunno....
Confused.
Because WHen I try to use thee details:
IMAP Server: as imap.charter.net SMPT Server: as smpt.charter.net
It doesnt work.
Then I tried to use
mail.mydomain.com
for both incoming & outgoing server.
And it is also doesnt work.
ANy ideas?
You have to use the outlook.com server, not your own domain:
Incoming mail server - imap-mail.outlook.com
Incoming mail server port - 993 (SSL)
Outgoing (SMTP) mail server - smtp-mail.outlook.com
Outgoing (SMTP) mail server port - 587 (SSL/TLS)
Outgoing server (SMTP) authentication - same settings as your incoming mail server
So I'm learning about SMTP and am trying to use telnet to send some mail over SMTP.
I've easilly been able to send mail to my gmail account via:
$ host gmail.com
...
gmail.com mail is handled by 5 gmail-smtp-in.l.google.com.
...
$ telnet gmail-smtp-in.l.google.com 25
Trying 74.125.142.27...
...
Connected to gmail-smtp-in.l.google.com.
...
HELO <me#test.com>
...
However, I'm having trouble sending from my gmail account. From what I understand about SMTP, I should be using SMTP to send mail from < mygmailaddress#gmail.com >
to the outgoing gmail SMTP servers, which in turn use SMTP to transfer the mail to the receivers incoming SMTP server ect.
However, I'm having difficulties. If I telnet into smtp.gmail.com via port 465 (gmail outgoing smtp mail server canonical), I'm immediately disconnected after starting with HELO <blah#blah.com>, or asked to STARTTLS. I can't find answers on how to proceed.
Any help is appreciated.
Sidenote: Currently I'm using Starbucks free Wi-Fi to access the internet. I'm actually unable to telnet directly from my computer (No route to host error). Instead, it only works if I ssh into a remote linux box on my school's network first, then telnet from there. Any idea why this is?
Thanks!
First of all, it looks like you're using the wrong port. Gmail exposes port 465 for SMTP over SSL and port 587 for SMTP with STARTTLS, as documented here. The difference between these two is that SMTP over SSL first establishes a secure SSL/TLS connection and conducts SMTP over that connection, and SMTP with STARTTLS starts with unencrypted SMTP and then switches to SSL/TLS. This is why you don't get a response to your HELO.
$ telnet smtp.gmail.com 587
Trying 74.125.25.108...
Connected to gmail-smtp-msa.l.google.com.
Escape character is '^]'.
220 mx.google.com ESMTP fr1sm24834956pbb.26 - gsmtp
HELO <me#test.com>
250 mx.google.com at your service
STARTTLS
220 2.0.0 Ready to start TLS
But even if you telnet to port 587 you still aren't going to be able to send any email by hand. In order to do anything interesting you will have to STARTTLS, and you won't be able to handle the SSL/TLS binary protocol to negotiate the encryption.
The telnet client will not negotiate a TLS session for you. You should use another tool, such as OpenSSL's s_client. The following issues the STARTTLS command for you and handles the TLS negotiation:
$ openssl s_client -starttls smtp -connect smtp.gmail.com:587 -crlf
Alternatively, you could connect directly to the SMTPS port:
$ openssl s_client -connect smtp.gmail.com:465 -crlf
I found this article which explains sending email from telnet
http://www.kongtechnology.com/2008/01/27/smtp-authentication-and-send-emails-using-telnet/
but actually I have problem with it.
when i wrote this command
auth login
I got
Connection to host lost.
so, what is the problem?
http://www.ionfish.org/mxlookup
Type the URL of the site you want to find's mail server.
Open CMD, type:
telnet mx.sitedomain.com 25
then
HELO mx.sitedomain.com
next
MAIL FROM: president#whitehouse.gov
then
RCPT TO: secretary#whitehouse.gov
finally
SUBJECT: This message was brought to you in part by the moon.
Note: You need to send authentication requests, because most mail servers do not allow anonymous unsolicited mail to be sent. (spam).
http://technet.microsoft.com/en-us/library/aa995718%28v=exchg.65%29.aspx