Mono support board

Start the conversation, ask questions and share tips and solutions with fellow developers.

Non-registered users can only browse through our support boards. Please register now if you want to post your questions. It takes a second and it is completely free. Alternatively, you can log in without registration using your credentials at major sites such as Google, Microsoft Live, OpenId, Facebook, LinkedIn or Yahoo.

Mono Support What are all the email settings needed for ssl smtp server like gmail? 

Viewed 6524 time(s), 3 post(s). 4/24/2012 11:41:47 PMby Jeremy
Jeremy
1

Jeremy 4/24/2012 11:41:47 PM

Hi,

From reading other posts, it seems like the web.config settings needed are:

<appSettings>
  <add key="MailFromAddress" value="mygmailname@gmail.com"/>
  <add key="EnableSmtpSSL" value="true"/>
</appSettings
<
system.net>
  <mailSettings>
    <smtp deliveryMethod="Network" from="mygmailname@gmail.com">
      <network host="smtp.gmail.com" userName="mygmailname@gmail.com" password="mygmailpassword" port="587" enableSsl="true" defaultCredentials="false" />
    </smtp>
  </mailSettings>
</system.net>

but I am getting the following error:

2012-04-25 09:23:41,404 [23] ERROR MonoX [admin] - An error has occured while sending you an e-mail. Please try again, if the problem persists, please contact us.
at MonoSoftware.MonoX.Mail.MonoXMailSender.SendMail(MailMessage mailMsg)
at MonoSoftware.MonoX.ModuleGallery.ContactFormModule.btnSend_Click(Object sender, EventArgs e)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. nv9sm15781248pbb.35
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 MonoSoftware.Core.Mail.MailSender.SendMail(MailMessage mailMsg)

I have checked the web.config settings by successfully sending an email using this code:

protected virtual void SendTestEmail(object sender, EventArgs e)
{//test sending email using gmail in web.config - works!
    MailMessage mailMsg = new MailMessage();
    mailMsg.To.Add("myhotmailname@hotmail.com");
    mailMsg.Subject = "Subject";
    mailMsg.Body = "Hi there, blah blah blah ... Regards me";
    mailMsg.IsBodyHtml = true;
 
    SmtpClient client = new SmtpClient();
    client.Send(mailMsg);
}


Is there another monox setting that I am missing to get the contact page to send an email?

I am using MonoX v4.7.40.3486 [4/18/2012], DB v4.7.3321

This content has not been rated yet. 
322 Reputation 36 Total posts
Jeremy
2

Jeremy 4/25/2012 4:10:48 AM

Yes, There is a check box "Enable SSL" on the Contact Form web part as well which overrides both the web.config settings. It can also be set declaratively:

<MonoX:ContactForm ID="ctlContact" runat="server"
A_WebSiteName="MonoX Demo" A_Address="Bihacka 1d" A_City="Osijek"
A_ZipCode="31000" A_Country="Croatia" A_Phone="+385 31 213 966" A_Fax="+385 31 213 967"  EnableSSL="true" A_EMail="info@domain.com"          
></MonoX:ContactForm>

After setting EnableSSL="true" on the web part everything started working.
This content has not been rated yet. 
322 Reputation 36 Total posts
khorvat
3

khorvat 4/25/2012 6:33:56 AM

Hi,

yes we did preset EnableSSL to false on ContactForm module so you have to change it or remove it completely.

Let us know if you need anything else.

Regards
This content has not been rated yet. 
11551 Reputation 1644 Total posts