1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

Email from C# windows application

Discussion in 'C#' started by mymindrules, Sep 23, 2013.

  1. #1
    Hello People

    I want to send email from windows desktop application which I am creating in visual studio using language c#. Can anyone tell me how can i send email using windows app?
    mymindrules, Sep 23, 2013 IP
  2. seotraining

    seotraining Active Member

    Likes Received:
    Best Answers:
    Trophy Points:
    You can use gmail api for it here is the code for it
    MailMessage m = new MailMessage("mailidofSender", To);
                m.Subject = Subject;
                m.Body = Body;
                m.IsBodyHtml = true;
                SmtpClient smtp = new SmtpClient();
                smtp.Host = "mail.google.com";
                NetworkCredential authinfo = new NetworkCredential("mailidfrom", "YourPassword");
                smtp.UseDefaultCredentials = false;
                smtp.Credentials = authinfo;
    Code (markup):
    seotraining, Sep 24, 2013 IP
    mymindrules likes this.