I'm setting my server to send mail through me gmail account but fails. I followed steps to set it up but I could not solve this problem.
I get the message "has a new email in var / www / root. And this text is displayed here, basically tells me that the authentication is required. Check this error in several replies in this forum and it said that my account gmail, was to give permits for less secure apps, which is activated it still does not work and I get this error.
Final-Recipient: RFC822; mymail@gmail.com
Action: failed
Status: 5.5.1
Diagnostic-Code: SMTP; 530-5.5.1 Authentication Required. Learn more at
Last-Attempt-Date: Wed, 4 May 2016 16:36:54 GMT
My sendmail.mc
define(`SMART_HOST',`[smtp.gmail.com]')dnl
define(`RELAY_MAILER_ARGS', `TCP $h 587')dnl
define(`ESMTP_MAILER_ARGS', `TCP $h 587')dnl
define(`confAUTH_OPTIONS', `A p')dnl
TRUST_AUTH_MECH(`EXTERNAL DIGEST-MD5 CRAM-MD5 LOGIN PLAIN')dnl
define(`confAUTH_MECHANISMS', `EXTERNAL GSSAPI DIGEST-MD5 CRAM-MD5 LOGIN PLAIN')dnl
FEATURE(`authinfo',`hash -o /etc/mail/authinfo/gmail-auth.db')dnl
define(`_USE_ETC_MAIL_')dnl
include(`/usr/share/sendmail/cf/m4/cf.m4')dnl
VERSIONID(`$Id: sendmail.mc, v 8.15.2-3 2015-12-10 18:02:49 cowboy Exp $')
OSTYPE(`debian')dnl
DOMAIN(`debian-mta')dnl
gmail-auth contain
AuthInfo: "U:root" "myaccount@gmail.com" "P:12345678"
If someone could help me, I am very new to these servers, try PHPMailer but it was the same problem with GMAIL authentication.