locked
Is it Possible to Send a Mail From a Web Application without using SMTP & OutLook? RRS feed

  • Question

  • User-1811084585 posted

    In a Web Application (ASp.NET/C#) I have to Implement a Mail Sending Utility But I don't have to use SMTP or IIS Web Server & No Outlook will be installed on the Server. Need to confirm from a larger audience about the concept of Sending of a Mail we need a Relay like (SMTP or Outlook), Is there any other way that we can use or write a Control which helps us in Sending the Mails from the Web Server? Like I was looking for MAPI but MAPI also uses SMTP or Outlook. 

    Friday, June 13, 2008 12:07 AM

All replies

  • User-1363023537 posted

    Hi,
     without using SMTP you can't send email.
     1. you can use your local IIS server SMTP
     2. you can use thrid party SMTP server like gmail or relay SMTP server provided by web hosting provider

    * You can use System.Net.Mail to send email
    * You can create your own email sending tool using System.Net
       TcpClient
       NetworkStream
       SslStream
       etc.
    http://www.systemnetmail.com/

    e.g. 

     System.Net.Mail.SmtpClient s = new System.Net.Mail.SmtpClient("smtp.gmail.com", 587);
             System.Net.NetworkCredential nc = new System.Net.NetworkCredential("myname", "mypass");
           
            s.EnableSsl = true;
            s.UseDefaultCredentials = false;
         
            s.Credentials = nc;
            s.Send("myname@gmail.com", "recepentEmailId@RecepentDomainl.com", "subject", "Email Body"); 


    Satalaj.

    Friday, June 13, 2008 2:26 AM