SitePoint Sponsor

User Tag List

Results 1 to 8 of 8
  1. #1
    SitePoint Member oh_neil's Avatar
    Join Date
    May 2005
    Posts
    11
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Ive been trying to send an email using the SmtpMail class in asp.net

    Ive been trying to send an email (via iis smtp virtual mail server) using the SmtpMail class in asp.net, but i keep getting a failure to deliver message. Is there something im not doing?

    MailMessage mail = new MailMessage();
    mail.From = "oh_neil@yahoo.com";
    mail.To = "to104@gre.ac.uk";
    mail.Body = "Test email";
    SmtpMail.SmtpServer = "localhost";
    SmtpMail.Send(mail);

  2. #2
    SitePoint Member
    Join Date
    May 2005
    Posts
    3
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi Neil
    There is no Error in the code Just Check YOur SmtpServer (Line 5) YOur Server is not Supporting for mail

  3. #3
    Afrika
    Join Date
    Jul 2004
    Location
    Nigeria
    Posts
    1,737
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    you should have posted this article in the .net forum

    http://www.sitepoint.com/forums/forumdisplay.php?f=141

  4. #4
    SitePoint Member oh_neil's Avatar
    Join Date
    May 2005
    Posts
    11
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I tried changing "localhost" to my machine name but still no succcess. How do i enable my machine to send Email given that my code is correct?

  5. #5
    ALT.NET - because we need it silver trophybronze trophy dhtmlgod's Avatar
    Join Date
    Jul 2001
    Location
    Scotland
    Posts
    4,836
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Make sure you have the SMTP service started and running in your IIS


  6. #6
    SitePoint Member oh_neil's Avatar
    Join Date
    May 2005
    Posts
    11
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    server is running and still nothing. is configuring your local SMTP virtual server enough to get it working? If so how do i configure it?

  7. #7
    ALT.NET - because we need it silver trophybronze trophy dhtmlgod's Avatar
    Join Date
    Jul 2001
    Location
    Scotland
    Posts
    4,836
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    What's the exact error message?

  8. #8
    SitePoint Addict
    Join Date
    Feb 2002
    Location
    Atlanta, GA
    Posts
    342
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)



Bookmarks

Posting Permissions

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