Reputation: 3521
I'm trying to make Sitecore send messages through a gmail-account but it wont work. This is my settings in web.config:
<setting name="MailServer" value="smtp.gmail.com" />
<!-- MAIL SERVER USER
If the SMTP server requires login, enter the user name in this setting
-->
<setting name="MailServerUserName" value="[email protected]" />
<!-- MAIL SERVER PASSWORD
If the SMTP server requires login, enter the password in this setting
-->
<setting name="MailServerPassword" value="secret" />
<!-- MAIL SERVER PORT
If the SMTP server requires a custom port number, enter the value in this setting.
The default value is: 25
-->
<setting name="MailServerPort" value="587" />
And this is the error from the log:
6068 09:14:57 ERROR Failed to send analytics report
Exception: System.Net.Mail.SmtpException
Message: The SMTP server requires a secure connection or the client was not authenticated. The server response was: 5.7.0 Must issue a STARTTLS command first. u9sm3416817eeh.17
Source: System
at System.Net.Mail.MailCommand.CheckResponse(SmtpStatusCode statusCode, String response)
at System.Net.Mail.MailCommand.Send(SmtpConnection conn, Byte[] command, String from)
at System.Net.Mail.SmtpTransport.SendMail(MailAddress sender, MailAddressCollection recipients, String deliveryNotify, SmtpFailedRecipientException& exception)
at System.Net.Mail.SmtpClient.Send(MailMessage message)
at Sitecore.MainUtil.SendMail(MailMessage message)
at Sitecore.Analytics.Reports.ReportMailer.Mail(String exportedReportFileName, IEnumerable`1 recipients, String reportTitle, Boolean embedFile, Boolean deleteFile)
I know that it has something to do with gmail requiring some kind of secure connection but how do I make Sitecore provide this?
Upvotes: 1
Views: 4013
Reputation: 404
In 8.2 update 4 (don't know about previous updates/releases) there's a special setting for that:
<setting name="MailServerUseSsl" value="true" />
Upvotes: 3
Reputation: 1262
I am successfully connect to GMAIL using Email Campaign module which has the STARTTLS feature. Here are my settings:
<!--Set it to "true" if you want use the SMTP settings below. You should purchase the right of using the "UseLocalMTA" setting first.-->
<setting name="UseLocalMTA" value="true" />
<setting name="SMTP.Server" value="smtp.gmail.com" />
<setting name="SMTP.Port" value="587" />
<setting name="SMTP.LoginDomain" value="" />
<setting name="SMTP.UserName" value="[email protected]" />
<setting name="SMTP.Password" value="12345" />
<setting name="SMTP.AuthMethod" value="PLAIN" />
<setting name="SMTP.StartTLS" value="true" />
Upvotes: 0
Reputation: 4008
The SendMail function in Sitecore.MainUtil does not have an option to set SmtpClient.EnableSsl to True. For now, it looks like you will need to find another SMTP server to use.
You may want to log this as a feature request with Sitecore.
Upvotes: 1
Reputation: 10478
Message: The SMTP server requires a secure connection or the client was not authenticated. The server response was: 5.7.0 Must issue a STARTTLS command first.
gmail requires TLS connection. Can try looking into stunnel
.
Anyways, serverfault or superuser.com is probably more appropriate.
Upvotes: 2