Click here to Skip to main content
15,917,627 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
i have created a website in which sign up/logic options are given. i want to send mail to all the registered user from my site, daily.
So provide me c# code for this.
Posted

1 solution

Its a simple code to send mail, make changes as per your requirements :
C#
var smtp = new System.Net.Mail.SmtpClient();
    {
        smtp.Host = "smtp.gmail.com";
        smtp.Port = 587;
        smtp.EnableSsl = true;
        smtp.DeliveryMethod = System.Net.Mail.SmtpDeliveryMethod.Network;
        smtp.Credentials = new NetworkCredential(fromAddress, fromPassword);
        smtp.Timeout = 20000;
    }
    // Passing values to smtp object
    smtp.Send(fromAddress, toAddress, subject, body);
 
Share this answer
 
Comments
Er.D.K.Malhotra 10-Dec-12 0:30am    
i have already tried this code ..but it doesn't work and this is only for gmail user. give solution for all type of user.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900