How to config SMTP with SSL in C1 Composite ?

Topics: General
Dec 14, 2010 at 2:37 AM

I can not send my email when i use SMTP ( GMail ) .

This is my config.

 
  <mailSettings>     
	 <smtp from="myemail@gmail.com">       
		 <network host="smtp.gmail.com" port="587" userName="myemail@gmail.com" password="mypassword" />     
	 </smtp>    
  </mailSettings>     
        
 
      
        
      
    

Dec 14, 2010 at 2:41 AM

Please clarify!

Steps to reproduce, expected behaviour, actual behaviour.

Do you have any exception or stacktrace you can show us?

 

Coordinator
Dec 14, 2010 at 2:45 AM

Do this work from a std. asp.net page that send mail? Composite C1 uses the std. .net api for mailing and if your settings are correct (and registered in web.config) you should be fine. 

Dec 14, 2010 at 2:53 AM

marcus, shouldn't you be sleeping by now? :P

In your subject you're saying that you want to use SSL, but then you should tell .Net that as well with the 

enableSsl="true"

attribute on network


Dec 14, 2010 at 3:04 AM

Hi all

 

I got this error when posting a comment . ( I use SMTP - Gmail ) 

"Failed to get value for function 'Composite.Community.Blog.BlogRenderer' - An error occurred during a call to extension function 'CallFunction'. See InnerException for a complete description of the error. - Failed to get value for function 'Composite.Community.Blog.Comments' - 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. p8sm9788036wff.16 - "

Dec 14, 2010 at 3:11 AM

thats because you havent enabled ssl

Dec 14, 2010 at 3:39 AM

 

I've just solved the problem

In SendMailFunction.cs

SmtpClient client = new SmtpClient();      

client.EnableSsl = true; // I just add this line

client.Send(mailMessage);

 

Thanks.

Dec 14, 2010 at 4:16 AM

my dear friend... you need to set it in your web.config, not hardcode it in code