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

Viewed 77690 time(s), 7 post(s), 4/24/2012 11:41:47 PM - by Jeremy
4/24/2012 11:41:47 PM
322 Reputation 36 Total posts

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

1
4/25/2012 4:10:48 AM
322 Reputation 36 Total posts

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.

2
4/25/2012 6:33:56 AM
15993 Reputation 2214 Total posts

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

3
7/18/2013 7:43:02 PM
123 Reputation 15 Total posts

Hi!

give me please advice how to use certifications? i need to put this in message send code:

ServicePointManager.ServerCertificateValidationCallback = delegate(object s, X509Certificate certificate, X509Chain chain, SslPolicyErrors sslPolicyErrors) { return true; };
               SmtpServer.Send(mail);

4
7/19/2013 6:59:28 AM
15993 Reputation 2214 Total posts

Hi,

you will have to build your own mail send functionality in order to add custom functionality. I can provide you with code snippets but you will have to let me know where do you want to include the above code ?

Can you please open a new topic for your issue ?

Thanks

5
3/25/2014 5:50:24 PM
30 Reputation 4 Total posts

Hi guys,

I configured the smtp in the web.config and i enable the SSL via the admin panel everything works, when there is a new topic in the discussion i get a mail.
 
I wanted to ask if there is a possibilty to get a mail when a discussion is created ? if there is, how ? 

Thank you

6
3/26/2014 8:45:55 AM
15993 Reputation 2214 Total posts

Hi,

can you please open a new topic for your issue, as we tend not to post to 2 year old topics. Also please elaborate this in your next post:
"I wanted to ask if there is a possibilty to get a mail when a discussion is created ? if there is, how ? "

Regards

7
This is a demo site for MonoX. Please visit Mono Software for more info.