Email problem

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • aradhanathawait
    New Member
    • Mar 2008
    • 36

    Email problem

    hi

    I am working on a asp.net web application that sends email to designated email ids. The platform is windows, c# and sql server2000. The email is working fine when I run it from localhost .but after hosting it on the server the email is not sent. I have opened the required port. please guide me what else may be the reason for the problem and also the solution. Please help.......

    following is the source code

    Code:
    System.Net.Mail.MailMessage Mail = new System.Net.Mail.MailMessage("trng.cg@gmail.com", tomail, submail, mesg);
    
    Mail.IsBodyHtml = true;
    
    System.Net.NetworkCredential mailAuthentication = new System.Net.NetworkCredential("trng.cg@gmail.com", "pwd");
    
                    System.Net.Mail.SmtpClient mailClient = new System.Net.Mail.SmtpClient("smtp.gmail.com", 587);
    
                    mailClient.EnableSsl = true;
                    mailClient.UseDefaultCredentials = false;
                    mailClient.Credentials = mailAuthentication;
                    mailClient.Send(Mail);
                    Response.Write("msg sent succesful");
    Thanx and regards,
    Aradhana
    Last edited by kenobewan; Oct 10 '08, 01:27 PM. Reason: Use code tags
  • kenobewan
    Recognized Expert Specialist
    • Dec 2006
    • 4871

    #2
    Do you get an error message?

    Comment

    • Frinavale
      Recognized Expert Expert
      • Oct 2006
      • 9749

      #3
      Check any firewall or proxy settings....
      Check your Windows Event log for any error messages.

      -Frinny

      Comment

      • teddarr
        New Member
        • Oct 2006
        • 143

        #4
        This deals more with sql server 2005, but it may offer you some valuable insight:

        http://imar.spaanjaars .com/QuickDocId.aspx ?quickdoc=395

        Comment

        Working...