C# Tutorial 75: How to send email using c#

41
3



How do I send mail using C#?
Send e-mail via SMTP using C#
c# – Sending email in .NET through Gmail
C# – Sending Email Through SMTP. – C#
Send Email using SMTP in C#
Sending Mail Using C# via SMTP
A class for sending emails with attachments in C#
How to send email using c# : The Official Microsoft ASP.NET
Searches related to send email c#
send email c# 2010
send email c# .net 4
send outlook email c#
send email c# 2008
send email html c#
send email attachment c#
asp.net send email c#
send email c#

Nguồn:https://wijstaanvooronzegrondrechten.org/

Xem Thêm Bài Viết Khác:https://wijstaanvooronzegrondrechten.org/cong-nghe

41 COMMENTS

  1. 2019 – how to send e-mail using OWA

    using Microsoft.Exchange.WebServices.Data;

    ExchangeService service = new ExchangeService(ExchangeVersion.Exchange2007_SP1);

    service.Credentials = new WebCredentials("example.man@gmail.com", "password");
    service.AutodiscoverUrl("example.man@flex.com", delegate (string url)

    {

    return MessageBox.Show(

    "Do you want to allow a redirection to " + url + " ?",

    "Allow redirection?",

    MessageBoxButtons.YesNo,

    MessageBoxIcon.Warning) == DialogResult.Yes;

    });

    EmailMessage message = new EmailMessage(service);

    message.Subject = "My auto mail from exchange server";

    message.Body = "hi everyone !";

    message.ToRecipients.Add("mybest.friend@gmx.com");

    message.SendAndSaveCopy();

  2. This is a fantastic and easy to understand video. If someone wants to send more emails, then Gmail SMTP might not be sufficient. With the same flow as explained in video, you can try integrating with Pepipost Nuget which gives 30k emails free per month for lifetime. Here is the Git link to the library: https://github.com/pepipost/pepipost-sdk-csharp

  3. i tried this and it won't send the email. is there an add on you need to download. it only gets up to the client.send(emailMessage) and it stops,after 2 minutes it throws a time out message. please help

  4. "The SMTP server requires a secure connection or the client was not
    authenticated. The server response was: 5.5.1 Authentication Required."
    if you got this error try to go to your gmail account and TURN ON your "less secure apps".

  5. Hi , i have a message Error :
    Le serveur SMTP requiert une connexion sécurisée ou le client n'était pas authentifié. La réponse du serveur était : 5.5.1 Authentication Required. Learn more at
    help me

  6. Hiii .. this code does not show any error during debugging. after click on send mail button it show error message in dialogbox Failure sending mail. plz help me.

  7. using System.Web;
    using System.Net.Mail;

    MailMessage mail = new Mailmessage("From", "To", "Subject", "Body");
    SmtpClient client = new SmtpClient("smtp.google.com");
    client.Port = 587;
    client.Credentials = new System.Net.NetworkCredential("Username", "Password");
    client.EnableSsl = true;
    client.Send(mail)
    MessageBox.Show("Email Sent!","Sent Successfully");

  8. Hello bro, isn't there any way to fix my email address and password?
    I mean, I only want preset my email address and password so that I need not to write it again and again..
    Please, help

  9. i wanna learn when someone buy something of my program like when he clicks on my button that says buy now he will put hes email and stuff and after 30mins a bot has to msg him back immeditly can u plz do a tut on it AS WELL THAT WILL BE VERY USEFUL THXX

  10. it's not working there is an error 🙁
     that The SMTP server requires a secure connection or the client was not authenticated. The server response was: 5.5.1 Authentication Required.

    what should i do ?

  11. When i am run the program "The SMTP server requires a secure connection or the client was not authenticated. The server response was: 5.5.1 Authentication Required. Learn more at" this error will occurred. And it shows this line "client.Send(mail);". what i do? can you tell me the solution?

  12. My mail isn't sending and I'm getting this error again and again that The SMTP server requires a secure connection or the client was not authenticated. The server response was: 5.5.1 Authentication Required.
    So what's the problem.?

  13. And almost i forgot to mention below sir! i did used visual studio 2013 to develop below mentioned program! is it a really matter that can gain such kind of error in my program sir?????? 

  14. i got this run time error when i run my program, if u can please explain this and help me to  solve my problem, then it could be a big help to me and i can be really glad-full for you sir! 

    "An unhandled exception of type 'System.Net.Mail.SmtpException' occurred in System.dll

    Additional information: The SMTP server requires a secure connection or the client was not authenticated. The server response was: 5.5.1 Authentication Required. Learn more at"

    Thank you

  15. Full CODE HERE

    using System;
    using System.Collections.Generic;
    using System.ComponentModel;
    using System.Data;
    using System.Drawing;
    using System.Linq;
    using System.Text;
    using System.Windows.Forms;
    using System.Web;
    using System.Net.Mail;

    namespace e_mail_send
    {
        public partial class Username : Form
        {
            public Username()
            {
                InitializeComponent();
            }

            private void button1_Click(object sender, EventArgs e)
            {
                MailMessage maile = new MailMessage(email_from.Text, email_add.Text, email_sub.Text, email_msg.Text);
                SmtpClient client = new SmtpClient(smtp.Text);
                client.Port = 587;
                client.Credentials = new System.Net.NetworkCredential(uname.Text,password.Text);
                client.EnableSsl = true;
                client.Send(maile);
                MessageBox.Show("email sent   hurraaaa !!!");
            }
        }
    }

  16. thanks alot for your helpful tutorials .
    i was trying to add a progress bar but it didn't work  even with research is seem gmail does not provide this service ! please  replay if you get my message or anyone knowhow to do it thanks .

  17. i used to hate indians … but now i don't ..

    Thank you so much … i really appreciate your video and your work .. simple and to the point ..

  18. Thank You Providing This Application.
    I will study this video and after try and this code Run Successfully And Mail Send Successfully.Thank You…………Again

  19. I get an error "desObj = Rijndael.Create ();" and down as I can not see what you write.
    What are you writing all the way down?

  20. Sir, you're fantastic. At first I was thrown off by how slowly you go through everything, but I have to say… it's a good thing you do. That way, I don't have to replay the video many times like I do with many other tutorials. I was able to get my email working with no problems. You're awesome! I would like to learn how to add attachments, if you can teach us that. 🙂

  21. on MailMessage mail = new MailMessage(From.Text, To.Text, Subject.Text , richTextBox2.Text); it says this is not to format that is needed for a email :S

LEAVE A REPLY

Please enter your comment!
Please enter your name here