OpenCart emails not sending - smtp

My OpenCart website uses SendGrid as its email sending system. This all worked correctly up until recently. When using functions which require sending an email to the admin (eg. new order alert emails, creating a new account), I've been getting this error:
Notice: Error: Password not accepted from server! in .../system/library/mail.php on line 251
In OpenCart Settings > Mail, my settings are as follows:
Mail Protocol: SMTP
SMTP Host: smtp.sendgrid.net
SMTP Username: <username>
SMTP Password: <pass>
SMTP Port: 25
SMTP Timeout: 5
This is according to SendGrid's documentation: https://sendgrid.com/docs/Classroom/Basics/Email_Infrastructure/smtp_ports.html
Can anyone advise? These settings work on my localhost. I contacted the host to see if they blocked the SMTP port, but they replied that they don't have the ability to block the port since the SMTP host is not their website, but instead SendGrid.

This is not a port problem. I had the same issue: the SendGrid documentation is wrong. Documentation screenshot reports SendGrid username, but you have to use 'apikey'. I suggest to use port 587.

Related

Odoo12: Setup SMPT Server with Sendinblue in Odoo. What I missed here?

I am trying to setup Sendinblue and use it as an SMTP server for my marketing and general Odoo 12 email messaging.
I setup every thing in Sendinblue and tested the SMTP Server in Odoo and got a "sucess" message under Settings / Technical / Outgoing Mail Servers.
For this I setup an external smpt server with the following data:
SMTP Server: smtp-relay.sendinblue.com
Email: my sendinblue email
Password: Password provided by sendinblue
Port: 587
Security: TLS (STARTTLS)
I can test the connection with success and set this SMTP Server as the server for sending email campaigns from Email Marketing / Settings / General Settings
Created a test email campaign and tried to send it and test it with no luck.
When Odoo tries to send the message, returns a "not delivered email" message with a unique reference and my local PC name, something like:
989345297097442.1625436965.401543280300903-openerp-reply_to#MYPC-NAME
I confirm sender email is registered and validated in Sendinblue. Using the same email as sender in Odoo.
Tried to do the same with my personal gmail account but even activating less secure apps, no message is sent from my instance.
What could be wrong?
I found the problem.
I had to verify the domain name I use for sending emails from Sendinblue service.
I have done it Senders & API main menu option on "domain" tab.
After verifying my domain name, everything is running fine

Msmtprc SMTP with Office365

I am configuring msmtprc smtp to send an outbound email and having a trouble with office365. It's working fine with Gmail account, but I am getting the following error with office 365.
msmtp: authentication failed (method LOGIN)
msmtp: server message: 535 5.7.3 Authentication unsuccessful [BN6PR13CA0016.namprd13.prod.outlook.com]
msmtp: could not send mail (account default from /etc/msmtprc)
/var/log/msmtp.log
Authentication unsuccessful [BN6PR13CA0016.namprd13.prod.outlook.com]' errormsg='authentication failed (method LOGIN)' exitcode=EX_NOPERM
/etc/msmtprc
defaults
auth on
logfile /var/log/msmtp.log
account office
host smtp.office365.com
port 587
protocol smtp
from support#example.net
user support#example.net
password *******
tls on
tls_starttls on
tls_trust_file /etc/pki/tls/certs/ca-bundle.crt
Does anyone successfully use Msmtprc with office365?
Thank you.
I've been successfully using msmtp fine for quite some time, using the following settings (on a CentOS 7 box), but with the config in $HOME/.msmtprc since it's just for my user rather than globally:
account default
host smtp.office365.com
port 587
tls on
tls_starttls on
tls_trust_file /etc/ssl/certs/ca-bundle.crt
tls_certcheck on
auth on
user username#example.com
passwordeval pass office365.com
from username#example.com
logfile ~/.msmtp.d/msmtp.log
..so this is 99% the same as yours except that instead of having the password in the file I'm using passwordeval to provide it via the output of the given command.
Perhaps multiple spaces between password and the password itself is causing the spaces to be added to the start of the password?
You could also try running msmtp so that it has a controlling terminal (i.e. run from the shell rather than via the service manager as with systemctl) to test whether providing it the password that way works as expected?

Prestashop SMTP Connection could not be established with host

I am having a problem configuring Prestashop SMTP.
I am trying to use gmail client.
SMTP server: smtp.gmail.com
Username: xxxxxxxx#gmail.com
Password: password_of_gmail
SSL
465
Error:
Connection could not be established with host smtp.gmail.com [Cannot assign requested address #99]
Gmail has turn off 2 step vertification, POP3 enabled, and Allow less secure apps enabled too.
Maybe your server doesn't allow external SMTP access.
For example 1and1 shared hosting doesn't allow that https://github.com/PHPMailer/PHPMailer/issues/816

How to use Gmail as your SMTP server for Youtrack?

Youtrack allow to send email through 3rd party SMTP server. Fields are as follows:
SMTP host: [?]
SMTP port: [?]
Mail protocol: [?]
SMTP login: [?]
SMTP password: [?]
Select SSL key: [?]
Server 'from' email: [?]
Could you provide an example of Gmail or Google apps config ?
Here is what I finally did:
SMTP host: smtp.gmail.com ;
SMTP port: 465 ;
Mail protocol: SMTP+SSL ;
SMTP login: user#domain.com or user#gmail.com ;
SMTP password: ****** ;
Select SSL key: No key ;
Server 'from' email: user#domain.com.
Gmail will ignore the from parameter so I put the same.
References
Enable IMAP in your Gmail settings (Gmail doc) ;
How to use Gmail as your SMTP server.
I was using 2-Step Verification on my Gmail Account and this caused an error sending an email. To resolve first I created an App Password (see: https://support.google.com/accounts/answer/185833)
NOTE: to be able to create an App Password it's absolutely necessary to enable 2-Step Verification in your google account. If you don't do it, you'll receive a message indicating that your account doesn't support App Passwords.
Then using these settings I was able to send a test email:
SMTP host: smtp.gmail.com
SMTP port: 465 ;
Mail protocol: SMTP+SSL
SMTP login: user#gmail.com
SMTP password: #newly created app password# ;
Select SSL key: No key ;
Server 'from' email: user#domain.com.
The other two answers are correct, but are alternatives:
if your google account is configured to use 2-step verification you must use an AppPaswword. In this case you cannot enable less secure apps.
if your google account is not configured to use 2-step verification, you must enable less secure apps, and log to your account from a browser in the machine where youtrack is installed (as pointed out in the comment). In this case you cannot create App Passwords.
Additional notes:
as you can see, the youtrack configuration is the same in both cases, save for the password, which is the AppPassword if you use the first option, or the account password, if you use the second one.
in the from email, the email account is ignored, but you can specify a friendly name if you use this syntax: "Friendly Name <myacount#gmail.com>" When someone receives a notification he'll see From: Friendly Name. The account, whichever you specify, will be replaced by the google account you're configuring.
Minor addition to other answers.
My account have no 2-step verification, but with this solution I didn't have to log in from browser on YouTrack server machine, neither didn't have to enable less secure apps.
Config:
SMTP Host: smtp.gmail.com
SMTP Port: 587
Mail Protocol: SMTP+TLS
SMTP Login: user#gmail.com
SMTP Password: ****** (account password)
Select SSL key: (Nothing selected)
From address: YouTrack <user#domain.com>
Next:
Try to send test email (the button right below youtrack config).
It will fail.
Now just login into google account from your regular browser.
You'll get a warning about recent blocked login attempt.
Open warning and verify the login attempt from IP of your youtrack server.
Done. Now you should be able to send test email successfully.

Exchange SQL Server 2008 Database Mail issue

In my web application I have created a mail sender class and set the configurations of web.config file like this:
<mailSettings>
<smtp deliveryMethod="PickupDirectoryFromIis">
<network host="smtp.domain.com"
port="587"
userName="mail#domain.com"
password="password"/>
</smtp>
</mailSettings>
This is sending email. But SQL Server database mail can not send mail with the same account info.
Only one difference is PickupDirectoryFromIis .
Is there any setting on exchange server?
In the SQL Server Logs the errors are following.
Message
The mail could not be sent to the recipients because of the mail
server failure. (Sending Mail using Account 2 (2012-09-30T16:55:04).
Exception Message: Cannot send mails to mail server. (The SMTP server
requires a secure connection or the client was not authenticated. The
server response was: 5.7.1 Client was not authenticated).
Looks like this is a Authentication issue or port no issue.
Authentication Issue:
—————————-
Please make sure you have put the information as explained below:
Server name: smtp.gmail.com ( this is really important)
port no: 587 ( on many website this is given as 465 which is wrong, use 587 )
Check : This server requires a secure connection
Check Basic Authentication
username: youremailid#gmail.com ( should have gmail.com)
password: XXXXXXXXXXXXX
confirm password: confirm your password
Port No Issue:
——————–
Make sure port 587 is opened in your machine if you are following above example. If you are using any other port number (usually its port 25) to set up database mail in your office, make sure you speak with your security team and ask them to unblock port 25. Once they unblock port 25, your databasemail will work.
Network Connectivity:
—————————–
Also check network connectivity from your machine, if you can connect to internet from your machine on which you are testing your database mail. To test, do the following
Start- Run- type cmd – Hit Enter
Type ping gmail.com -t and then hit enter.
If output displays as Request timed out, it actually means there is network connectivity problem. Otherwise, your network connectivity is good.