command line smtp gmail not sending the email - email

Hey guys im trying to send and email using the command prompt.
Im using this command to contact gmail's server:
openssl s_client -starttls smtp -connect smtp.gmail.com:587 -crlf -ign_eof
Then i continue with contacting the server as shown in the picture.
The server allows me to enter the DATA but not to put . to end it.
If someone can help me fix this i will really appreciate it.
I blanked stuff to protect my privacy / account

Related

How to send a test email over SMTP with Mailgun using telnet?

I have configured Mailgun for my domain: blog.kop.com (fake domain), I have reset my SMTP password for this domain on mailgun dashboard.
I usually use the Mailgun API, this is why I want to test the SMTP sending from command line to check that I have the correct credentials, as an example, I'll use the following password:
Username: postmaster#blog.kop.com (guessed by me)
Password: d3bec33d3bc3e333333b3e333a3e33-3a3aa3d3-333ddf3 (given by mailgun)
This is what I do:
Convert the username to base64:
$ echo postmaster#blog.kop.com | base64
cG9zdG1hc3RlckBibG9nLmtvcC5jb20K
Convert the password to base64:
$ echo d3bec33d3bc3e333333b3e333a3e33-3a3aa3d3-333ddf3 | base64
ZDNiZWMzM2QzYmMzZTMzMzMzM2IzZTMzM2EzZTMzLTNhM2FhM2QzLTMzM2RkZjMK
Test send email over SMTP on port 587 (STARTTLS) with telnet client:
$ telnet smtp.mailgun.org 587
Trying 3.93.221.84...
Connected to smtp.mailgun.org.
Escape character is '^]'.
220 Mailgun Influx ready
ehlo blog.kop.com
250-smtp-out-n01.prod.us-east-1.postgun.com
250-AUTH PLAIN LOGIN
250-SIZE 52428800
250-8BITMIME
250-SMTPUTF8
250-PIPELINING
250 STARTTLS
AUTH LOGIN
334 VXNlcm5hbWU6
cG9zdG1hc3RlckBibG9nLmtvcC5jb20K
334 UGFzc3dvcmQ6
ZDNiZWMzM2QzYmMzZTMzMzMzM2IzZTMzM2EzZTMzLTNhM2FhM2QzLTMzM2RkZjMK
535 Authentication failed
Connection closed by foreign host.
It seems that my credentials are incorrect, this is mailgun documentation for sending mail over SMTP: https://documentation.mailgun.com/en/latest/user_manual.html#sending-via-smtp
I also tried using there code snippet and their swaks program: https://documentation.mailgun.com/en/latest/quickstart-sending.html#send-via-smtp
I also have the wrong credentials. I copy pasted the credentials and aknowledged that they are correct.
I already got this issue using the API, the mailgun documentation was providing the wrong api address for europe region. I now believe smtp.mailgun.org is not the right server for Europe region but I can't find anything related to it.
What's wrong with those steps?
Why I am failing to send email?
How can I send email over SMTP with mailgun, starttls and telnet?
When you echo a string you include a newline, but the newline should not be included in the credentials you pass in to SMTP AUTH. Try
printf '%s' 'postmaster#blog.kop.com' | base64
and similarly for the password.
Using bare Telnet sounds like a pretty brittle approach; you really want to use a proper SMTP client to talk to the SMTP server.
For europe, the SMTP address is smtp.eu.mailgun.org.

Can't get outbound email working in self-hosted SugarCRM 6.5

I can't seem to get outbound email working from my SugarCRM installation, with only the message SMTP connect() failed appearing in the logs.
I've set my smtp server to smtp.gmail.com, email address, password, TLS, port 587. When I go to 'Send Test Email' I get the error.
I've set my local hostname, installed openssl, set the host_name in config.php and included it as a referrer in config_override.php. I've also tried setting SMPTDebug to 2 in SugarPHPMail.php but that seemed to have no effect.
When I run openssl s_client -starttls smtp -crlf -connect smtp.gmail.com:587 the output includes Verify return code: 0 (ok) and I don't know where to go from here. I can connect via telnet to that host & port and get a 220 SMTP message back as expected.
I do also have an exchange server available, but haven't been able to get that one working either, and thought Gmail would be more easily-solved.
I'm on Sugar 6.5.26 hosted on Linux (Debian, Raspbian).
Ok I found the solution while looking for the 'Allow less secure apps' setting in Gmail.
I have two-step authentication switched on in my Gmail account, which will obviously complicate things but had slipped my mind. Therefore I needed to use an app-specific password, and not my normal Gmail password.
As soon as I created an app-specific password in Google (at https://myaccount.google.com/apppasswords) and plugged that into the SugarCRM settings, it worked fine. D'oh!

Smtp server not returning error

I have problem with checking existing of gmail account. For connecting to smtp server i use openssl for Windows. After run i writing next line to connect to server:
s_client -starttls smtp -crlf -connect smtp.gmail.com:587
After connect, i login on server using auth login.
After this i starting to create new mail:
C:mail from:<somegmail#gmail.com>
S:250 2.1.0 OK w7sm27345781wiz.0
C:rcpt to:<incorrectEmail#asas.com> //input incorrect email
S:250 2.1.0 OK w7sm27345781wiz.0
But after input incorrect email server must return error:
550-5.1.1 The email account that you tried to reach does not exist...
Why server not return error?
The sending server accepts your message, for sending, but does not check if the destination is actually valid at this time. That is why you have a success message.
The server is basically telling you: "Ok I have your message and will try to deliver it"
It will be later, when the gmail.com server talks with the asas.com server, that the asas.com server will give an error, at which time you will receive a bounce email from Gmail

Gmail smtp configuration for Drupal 7

I want to send email in Drupal 7. So, does anyone know how to configure Gmail SMTP on Drupal 7?
Download SMTP module and enable it.
Go to Admin > Configuration > SMTP authentication support and set the following values:
Turn on the module at the Install options fieldset at the top.
SMTP server settings:
smtp server: smtp.gmail.com
smtp backup server: leave blank.
smtp port: 465
use encrypted protocol: select "use SSL"
SMTP authentication:
Enter a valid Gmail email address and password.
Email options:
Set the same email address that you used at SMTP Authentication. Using a different account is called Phishing
Send test email: set an email to receive a sample email.
Enable debugging: yes.
3. Click on submit and verify that the email was submitted and that you received it. If not, read carefully the debug information at the top of the screen. Once satisfied, remember to deactivate the debug checkbox.
Step 1: Download SMTP module and enable it.
Step 2: Go to Admin > Configuration > System > SMTP authentication support and set the following values:
Turn this module on or off: On.
SMTP server settings:
smtp server: smtp.gmail.com
smtp backup server: leave blank.
smtp port: 465
use encrypted protocol: select "use SSL"
SMTP authentication:
Enter a valid Gmail email address and password.
Email options:
Set the same email address that you used at SMTP Authentication.
Send test email: set an email to receive a sample email and to test whether the module is working.
Enable debugging: yes.
Step 2a(Optional): Allow Less Secure Apps Access which is here: http://www.google.com/settings/security/lesssecureapps
Step 3: Click on Save and go to your inbox to check. If there is an testing email then it is fine.
Note: Your email address provided in your smpt setting MUST be the same like in your site information.
I hope SMTP Authentication Support module will help you.
For me, just following the steps in Juampy's answer didn't work. The error "Unable to send mail. Contact site administrator." continued to display. Do the following first and then configure SMTP module as per his answer.
Before installing SMTP module, download PHPMailer and extract it. Rename the folder as 'phpmailer' and copy the folder into module folder of SMTP module. Then, install the SMTP module.
An alternative configuration is as follows:
smtp port: 587
use encrypted protocol: select "use TLS"
This blog entry has some more up-to-date info:
http://www.stevepolitodesign.com/blog/drupal-configure-smtp-module-work-gmail-updated
Install and set-up module:
Install the SMTP Authentication Support module in the usual way.
Navigate to the configuration page admin/config/system/smtp
Under Turn this module on or off select On. You can leave Send mail
by queue and Retry sending mail on error. deselected by default, but
selecting them won't affect Gmail.
Under SMTP server enter the following smtp.gmail.com. Leave SMTP
backup server blank
Under SMTP port enter 587 ​
Under Use encrypted protocol select Use TLS ​
Under SMTP AUTHENTICATION enter a Gmail address and password.
Under E-MAIL OPTIONS use the same Gmail address as you did above and
enter an E-mail from name
Click Save
Update gmail account settings:
Login to your Gmail account at https://myaccount.google.com/
On the account homepage, click Sign-in & security or navigate to https://myaccount.google.com/security
Scroll down to the Allow less secure apps: widget, and have it enabled.
Now navigate to https://accounts.google.com/DisplayUnlockCaptcha and click Continue
Go back to the SMTP configuration page admin/config/system/smtp
Enter an email address you would like to receive a test message from and click Save configuration
Check your inbox to confirm you received the test message.

Dotproject

I Have install dot project on linux machine. using ssmtp for gmail account to sending emails for mails notifications . but when i create any user it doesn't send mails to user email ID for account creation. but i send maail form shell prompt.the error i am getting is Failed to send email: 530 5.7.0 Must issue a STARTTLS command first. 22sm11794837wfd.6 added :( . Please help me if any one have solution....
Gmail requires a secure connection (TLS or SSL).
You need to configure SSMPT (not dotProject) to talk securely with Google's SMTP server.
I think you can just add the following to your ssmtp.conf file and (assuming your SSMTP package was compiled with SSL support) it should then work:
UseTLS=YES
Or perhaps:
UseSTARTTLS=YES
More info here.
I assume "530 5.7.0 Must issue a STARTTLS command first." means that you have to connect with TLS (Transport Layer Security). Does dot project support that?