trouble with Mail V2 from a web site

Discussion in 'Visual Studio' started by WynApse, Sep 24, 2006.

Thread Status:
Threads that have been inactive for 5 years or longer are closed to further replies. Please start a new thread.
  1. Thanks...

    localhost took care of it.

    Since I have this line showing in my code:

    SmtpClient client = new SmtpClient("localhost");

    I guess I don't understand your first comment about updating my smtp method.

    Other than the fact that your example is in VB, unless I'm missing something obvious, we match :)

    Thanks!

    -Dave
     
  2. ...Great. [​IMG]

    The other isn't important, simply referencing a change inSMTP mail from .NET v1.1 to v2.
     
  3. I have a site that's been running over a year now, and one of the pages is a form that is populated from a database that one of my instructors fills out and sends.

    My code (C#, .NET 2.0) then scrapes the data and sends it to the instructor and me via SmtpClient. This worked Soooo smoothly when I first did it, I thought I was a genius :)

    It's not working now, though, and I have a feeling it has not since the email v2 was setup on my site.

    The body of the method, as it has been for a long while, and working:




    string sRet;


    sRet = OutputLabel.Value;


    string sID = LocSupt.GetID();


    string sTo = "[email protected]";


    string sToAlso = LocSupt.GetEmailFromID(sID);


    string sFrom = "[email protected]";


    SmtpClient client = new SmtpClient("mail.wynapse.com");


    MailAddress From = new MailAddress(sFrom);


    MailAddress to = new MailAddress(sTo);


    MailMessage message = new MailMessage(From, to);


    message.Body = sRet;


    message.Subject = LocSupt.GetReportHeader(sID);


    client.Send(message);


    MailAddress toAlso = new MailAddress(sToAlso);


    MailMessage messageAlso = new MailMessage(From, toAlso);


    messageAlso.Body = sRet;


    messageAlso.Subject = LocSupt.GetReportHeader(sID);


    client.Send(messageAlso);





    The instantiation of the SmtpClient with "mail.wynapse.com" is probably no good any more. I've tried smtp.wynapse.com and smtp.west.cox.net (my ISP), but none of the three do anything more than throw an error.


    Having the cox smtp in there worked fine from localhost, so I have no reason to believe it's the code, particularly since it's been running all along.


    Any thoughts and/or assistance would be gladly accepted!


    -Dave
     
  4. You should update your smtp method if you're site is running v2 of the framework.
    i.e. Dim SmtpClient As New System.Net.Mail.SmtpClient

    For now, try changing your host from mail.wynapse.com to localhost
     
Thread Status:
Threads that have been inactive for 5 years or longer are closed to further replies. Please start a new thread.

Share This Page