Click here to Skip to main content
16,012,223 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Plz tell me the answer
and having the sent items of these messages and mails must be stored also

the preferred language C# code and back end MS SQL 2008(VS 2010)
Posted

Hi,

check this link for sending mail to email ids

http://www.codeproject.com/KB/aspnet/EmailApplication.aspx

And

http://www.codeproject.com/KB/aspnet/EasySMTP_package.aspx

And you've to send SMS to mobiles.then you want to buy that service form

service providers like http://www.groupsmsindia.com/[^]

there are so many services in market for sending sms

And you can save in your database while sending mails or sms

All the Best
 
Share this answer
 
Comments
sandhya.T 2011 12-Oct-11 6:05am    
Thanq so much for giving reply to me i'l try it
to send email code refer this link

How to send email through asp.net[^]

to send sms you need gateway api.
 
Share this answer
 
To send email

C#
public int SendUserMail(string fromad, string toad, string body, string header, string subjectcontent)
    {
        int result = 0;
        MailMessage usermail = Mailbodplain(fromad, toad, body, header, subjectcontent);
        SmtpClient client = new SmtpClient();
        //Add the Creddentials- use your own email id and password
        client.Credentials = new System.Net.NetworkCredential("abc@gmail.com", "password"); ;
                client.Host = "smtp.gmail.com";
        client.Port = 587;
        client.EnableSsl = true; 
        try
        {
            client.Send(usermail);
            result = 1;
        }
        catch (Exception ex)
        {
            result = 0;
        } // end try 

        return result;

    }



C#
public MailMessage Mailbodplain(string fromad, string toad, string body, string header, string subjectcontent)
   {
       System.Net.Mail.MailMessage mail = new System.Net.Mail.MailMessage();
       try
       {
           string from = fromad;
           string to = toad;
           mail.To.Add(to);
           mail.From = new MailAddress(from, header, System.Text.Encoding.UTF8);
           mail.Subject = subjectcontent;
           mail.SubjectEncoding = System.Text.Encoding.UTF8;
           mail.Body = body;
           mail.BodyEncoding = System.Text.Encoding.UTF8;
           mail.IsBodyHtml = true;
           mail.Priority = MailPriority.High;
       }
       catch (Exception ex)
       {
           throw;
       }
       return mail;
   }

To send sms you need follow sms gate way API
 
Share this answer
 
v2

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