Results 1 to 3 of 3

Thread: Sending Email using C#.

Threaded View

  1. #1

    Thread Starter
    Frenzied Member
    Join Date
    Jan 2009
    Location
    Watch Window(Shift+f9)
    Posts
    1,879

    Question Sending Email using C#.

    can someone tell me ?Why i am getting the following error .When i tries to compile the following .Thanks in Advance.Error 1 'System.Net.Mail.MailMessage.Subject' is a 'property' but is used like a 'method' Error 2 'System.Net.Mail.MailMessage.Body' is a 'property' but is used like a 'method'
    Error 3 No overload for method 'Send' takes '0' arguments
    Code:
     private void SendMail() {
                MailMessage Message=new MailMessage();
                Message.To.Add("[email protected]");
                Message.Subject("Clark Weekly Sales");
                Message.From = new MailAddress("[email protected]");
                Message.Body("Automatic Weekly Sales For Clk Brand");
                SmtpClient smtp = new SmtpClient("mail.alhokair.com.sa");
                smtp.Send();         
            
            
            }
    Last edited by firoz.raj; Oct 11th, 2011 at 05:23 PM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width