umbraco.library.SendMail: Error sending mail. Exception: System.Net.Mail.SmtpException: 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. p32sm2206028ybk.8 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 umbraco.library.SendMail(String FromMail, String ToMail, String Subject, String Body, Boolean IsHtml)
You can add a feature suggestion on codeplex if you think this extension should be modified. However I'm not sure they will change the extension. But maybe this could be a great suggestion for the uComponents package? Maybe you could contribute to that project because there is no doubt about it's a good idea :-)
One bit of advice, try not to use the inline code/script blocks within your XSLT files. As they are compiled for each and every page load (and stored on your server's temp folder). If possible, move the code to an App_Code class. (or even better a separately compiled assembly).
How to send email via secure connection?
Hello Umbraco Community,
I am getting following error while sending email via following xslt:
umbraco.library.SendMail: Error sending mail. Exception: System.Net.Mail.SmtpException: 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. p32sm2206028ybk.8 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 umbraco.library.SendMail(String FromMail, String ToMail, String Subject, String Body, Boolean IsHtml)
How to send email via secure connection?
Hello Pinal
Have you setup the SMTP information i the web.config at all?
/Jan
Yes smtp setting are fine in web.config
Hi Pinal
Maybe this could have something to do with the settings in google apps?
Try reading this answer here - I think part 1 could be worth checking out: http://www.google.com/support/forum/p/Google%20Apps/thread?tid=396e53acd0030ef4&hl=en
/Jan
I don't think any issue with google.
I was looking at code in umbraco.library.SendMail
Looks Umbraco library is not taking care of enabling SSL.
I modifed the code as below and is working fine.
Hi Pinal
ah yes of course, my bad..you needed to be able to send using SSL...
Oh well, nice that you got it fixed and posted the solution for future reference other can benefit from :-)
/Jan
Can we suggest Umbraco dev team to add one more overload for umbraco.library.SendMail method to take parameter for enabling SSL?
Hi Pinal
You can add a feature suggestion on codeplex if you think this extension should be modified. However I'm not sure they will change the extension. But maybe this could be a great suggestion for the uComponents package? Maybe you could contribute to that project because there is no doubt about it's a good idea :-)
/Jan
Hi
Below is my XSLT/Macro solution for sending emails from Umbraco via SSL.
Assumning smtp settings done properly in web.config as below:
Thanks & Regards,
Pinal Bhatt
Hi Pinal,
One bit of advice, try not to use the inline code/script blocks within your XSLT files. As they are compiled for each and every page load (and stored on your server's temp folder). If possible, move the code to an App_Code class. (or even better a separately compiled assembly).
More info on the XSLT code issue: http://www.tkachenko.com/blog/archives/000620.html
... and Doug has a blog post on how he moved his XSLTsearch code over to App_Code: http://blog.percipientstudios.com/2010/11/12/make-an-app_code-xslt-extension-for-umbraco.aspx
Cheers, Lee.
This is an awesome exercise for someone like me new to this kind of CMS.
Nice advice Lee !
Thank you Pinal, your support is much appreciated.
Umbraco comunity looks better and better to a newbie like me ;)
You're beginning to see the orange light!
is working on a reply...