what are the codes to send email?

  • 11 years ago

    Hi.... somebody knows what are the codes to send email? 




  • 11 years ago

    using System.Web.Mail;

    MailMessage mail = new MailMessage();
    mail.To = "me@mycompany.com";
    mail.From = "you@yourcompany.com";
    mail.Subject = "this is a test email.";
    mail.Body = "this is my test email body";
    SmtpMail.SmtpServer = "localhost"; //your real server goes here
    SmtpMail.Send( mail );

Post a reply

Enter your message below

Sign in or Join us (it's free).


Why not write for us? Or you could submit an event or a user group in your area. Alternatively just tell us what you think!

Our tools

We've got automatic conversion tools to convert C# to VB.NET, VB.NET to C#. Also you can compress javascript and compress css and generate sql connection strings.

“The most exciting phrase to hear in science, the one that heralds new discoveries, is not 'Eureka!' but 'That's funny...'” - Isaac Asimov