locked
TROUBLE IN SENDING EMAIL FROM SMTP IIS 7 IN WIN SERVER 2008 RRS feed

  • Question

  • User-394599836 posted

    I have created a code snippet that send mail properly by using the proper credentials like username, password, port and hostname of gmail smtp. but it is not sending the mail if we configured using an iis in local host. can anyone can helpout me.

    CODE BLOCK

    mailMessage.Subject = strSubject;
    mailMessage.IsBodyHtml = true;
    mailMessage.Body = strBody;
    mailMessage.Priority = MailPriority.Normal;
    SmtpClient client = new SmtpClient(strMailserver, intPort); // smtp.gmail.com,25
    NetworkCredential info = new NetworkCredential(strUsername, strPassword);
    client.DeliveryMethod = SmtpDeliveryMethod.Network;
    client.Credentials = info;
    client.Send(mailMessage);

    In above code what should be the value has to be given for the mailserver and port, when we configured through iis. I have an IP address which has been configured in IIS SMTP without any mailing credentials. How can i send mail now.


    Example IP Address : 192.168.xx.xxx
    Note : This doesn't have any Mail Credentials but configure in IIS 7, in OS Version : WINDOWS SERVER 2008

    Monday, April 29, 2013 9:20 AM

Answers