Hello. Ty for the video. I am having trouble though. While trying to connect to gmail smtp host i always get the exception stating that the SSL certificate handshake failed. I guess you were trying to configure it in 8:48 (probably disabling certificate validation at all?) but you deleted that line. It seems to be working on your machine even without configuring it. Do you have any clue what might cause the problem? I am using win 10, do i need to register certificates manually or what..? Thanks in advance
if you want that code: using (var client = new SmtpClient ()) { // For demo-purposes, accept all SSL certificates (in case the server supports STARTTLS) client.ServerCertificateValidationCallback = (s,c,h,e) => true; client.Connect ("smtp.friends.com", 587, false); // Note: only needed if the SMTP server requires authentication client.Authenticate ("username", "password"); client.Send (message); client.Disconnect (true); } Check your gmail account secuirty settings enabled if so then disable it because that might block unauthorised mail and also check this new video ruclips.net/video/V8tULZM5qNM/видео.html
thank you for your rapid answers. When i added the following: client.ServerCertificateValidationCallback = (s,c,h,e) => true; it worked. It doesnt validate the server certificate now. I wonder why is it a problem on my machine? looks like i dont have some certificates installed on it. Did you install some additional certificates? BTW i will surely check out your latest video, 'cause im actually building a chat application, thanks ;)
ExtendedSocketException: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond.
You can use html tags because using view is bit complicated but if users asks these stuff more then i will add video on that. Alternatively var bodyBuilder = new BodyBuilder (); bodyBuilder.HtmlBody = "This is some html text"; message.Body = bodyBuilder.ToMessageBody (); client.Send (message);
Thank you for your response, you helped me seeing the concept. Since I'm trying to send newsletters, it would be easier if I could use a view to send the email, instead of on each version of the newsletter, building the HTML body on the controller. Thanks a lot for the help.
Hey friends, Hope you enjoyed and learned a lot in this video.
Please subscribe to this channel: ruclips.net/channel/UCYl5G87mJQJOOQoAevAzd5w
Easy to follow and it works. Thanks.
It works fine in development mode when I deployed in Local IIS server mail is not working (i did not get the mail) any fix
It is very useful, Thank You !!
Hello. Ty for the video.
I am having trouble though. While trying to connect to gmail smtp host i always get the exception stating that the SSL certificate handshake failed. I guess you were trying to configure it in 8:48 (probably disabling certificate validation at all?) but you deleted that line. It seems to be working on your machine even without configuring it. Do you have any clue what might cause the problem? I am using win 10, do i need to register certificates manually or what..?
Thanks in advance
if you want that code:
using (var client = new SmtpClient ()) {
// For demo-purposes, accept all SSL certificates (in case the server supports STARTTLS)
client.ServerCertificateValidationCallback = (s,c,h,e) => true;
client.Connect ("smtp.friends.com", 587, false);
// Note: only needed if the SMTP server requires authentication
client.Authenticate ("username", "password");
client.Send (message);
client.Disconnect (true);
}
Check your gmail account secuirty settings enabled if so then disable it because that might block unauthorised mail and also check this new video ruclips.net/video/V8tULZM5qNM/видео.html
Make sure you are running your app in https mode
thank you for your rapid answers. When i added the following:
client.ServerCertificateValidationCallback = (s,c,h,e) => true;
it worked. It doesnt validate the server certificate now. I wonder why is it a problem on my machine? looks like i dont have some certificates installed on it. Did you install some additional certificates?
BTW i will surely check out your latest video, 'cause im actually building a chat application, thanks ;)
how will we get to know which port no. we have to use , like you have use 587.
is this valid for asp.net core 3 ?
Thank you very much brother, you made it very simple and easy. Please, where are the other videos?
ruclips.net/p/PLWaICQIaKdJa_dt2AxFHSQJENZec7epGc
Check this out
ExtendedSocketException: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond.
Nice Tutorial
Hi!
Nice tutorial first of all!
Is it possible to send a view as the body of the email?
Thank you in advance.
You can use html tags because using view is bit complicated but if users asks these stuff more then i will add video on that.
Alternatively
var bodyBuilder = new BodyBuilder ();
bodyBuilder.HtmlBody = "This is some html text";
message.Body = bodyBuilder.ToMessageBody ();
client.Send (message);
Thank you for your response, you helped me seeing the concept.
Since I'm trying to send newsletters, it would be easier if I could use a view to send the email, instead of on each version of the newsletter, building the HTML body on the controller.
Thanks a lot for the help.
nice
thank you
Ty bro
thank you bro