-----------------------------------------------------------

New Message on BDOTNET

-----------------------------------------------------------
From: HomelikeBlueTitan
Message 5 in Discussion

Here is the code/pseudocode.

public static void SendMail(string success)
                {
                        try
                        {
                                // Construct a new mail message
                                MailMessage message = new MailMessage();
                                message.From = 
ConfigurationSettings.AppSettings["from"].ToString();
                                message.To   = 
ConfigurationSettings.AppSettings["to"].ToString();
                                message.Cc   = 
ConfigurationSettings.AppSettings["cc"].ToString();
                                message.Subject = 
ConfigurationSettings.AppSettings["subject"].ToString();
                                message.Body = "The backup started at:  " + 
starttime + "\r  and ended " 
+ success + " at :" + DateTime.Today.ToLongDateString() + DateTime.Now;


                                //if you want attach file with this mail, add 
the line below
                                //message.Attachments.Add(new 
MailAttachment("c:\\attach.txt", 
MailEncoding.Base64));

                                // Send the message
                                SmtpMail.Send(message);

                        }

                        catch(Exception ex)
                        {
                                
System.Diagnostics.EventLog.WriteEntry("BackupApplication","Error 
occured while sending the mail",System.Diagnostics.EventLogEntryType.Error);
                                System.Console.WriteLine(ex.Message.ToString());
                        }

                }

Dont forgrt to include the following namespace.
using System.Web;
using System.Web.Mail;

Regards,
Suresh.

>From: "sndshreeman" <[EMAIL PROTECTED]>
>Reply-To: "BDOTNET" <[email protected]>
>To: "BDOTNET" <[email protected]>
>Subject: Re: e-mail through c# windows application
>Date: Tue, 19 Apr 2005 23:17:11 -0700
>



-----------------------------------------------------------

To stop getting this e-mail, or change how often it arrives, go to your E-mail 
Settings.
http://groups.msn.com/BDOTNET/_emailsettings.msnw

Need help? If you've forgotten your password, please go to Passport Member 
Services.
http://groups.msn.com/_passportredir.msnw?ppmprop=help

For other questions or feedback, go to our Contact Us page.
http://groups.msn.com/contact

If you do not want to receive future e-mail from this MSN group, or if you 
received this message by mistake, please click the "Remove" link below. On the 
pre-addressed e-mail message that opens, simply click "Send". Your e-mail 
address will be deleted from this group's mailing list.
mailto:[EMAIL PROTECTED]

Reply via email to