CodeVerge.Net Beta


   Item Entry   Register  Login  
Microsoft News
Asp.Net Forums
IBM Software
Borland Forums
Adobe Forums
Novell Forums




Can Reply:  No Members Can Edit: No Online: Yes
Zone: > Asp.Net Forum > visual_studio.visual_studio_2005 Tags:
Item Type: Date Entered: 11/3/2009 10:09:29 AM Date Modified: Subscribers: 0 Subscribe Alert
Rate It:
NR
XPoints: N/A Replies: 0 Views: 5 Favorited: 0 Favorite
3 Items, 1 Pages 1 |< << Go >> >|
"sathis_saas" <
NewsGroup User
Please help in sending mail using asp.net 2.0 plesk 8.211/3/2009 10:09:29 AM

0

Please help in sending mail using asp.net 2.0,


I have seen so many codes in google for sending email using asp.net 2.0 but the problem is i am having plesk 8.2 server in the domain and do'nt know

how to configure the smtp server( default port is 25) and i am having username and password but still there is problem in sending the mail.

"sathis_saas" <
NewsGroup User
100 % mail sending working for plesk webmail Users11/14/2009 8:40:56 AM

0

100% Working sending mail using asp.net 2.0  with plesk

Here is code for Plesk Users Or Webmail In Plesk:

 

using System.Net.Mail; //namespace should be used


MailMessage message = new MailMessage();

 

            message.From = new MailAddress("mail@domain.co.in");

 

            message.To.Add(new MailAddress("sathis_saas@hotmail.com"));

 

            message.Subject = "test";

 

            message.Body = "This is test";

 

            SmtpClient smtp = new SmtpClient("webmail.domain.com");

 

            smtp.Credentials = new System.Net.NetworkCredential("username@domain.com", "password");

 

            smtp.Port = 25;

 

            smtp.EnableSsl = false;

 

            smtp.Send(message);

 

 

            Response.Write("Email was queued to disk");

"Babunareshnarr
NewsGroup User
Re: 100 % mail sending working for plesk webmail Users11/14/2009 9:02:14 AM

0

public bool SendMail(string To_Mail, string Mail_Title, string Message_Body, bool Is_Html)
        {
            MailMessage smail = new MailMessage();
            smail.IsBodyHtml = Is_Html;
            smail.BodyEncoding = System.Text.Encoding.GetEncoding("iso-8859-1");
            smail.From = new MailAddress("aaaaa@bbbbbbbb.com", "My Name");
            smail.To.Add(new MailAddress(To_Mail));//To_Mail

            smail.Subject = Mail_Title;
            Message_Body = Message_Body.Replace("\r<br />", "<br />");
            smail.Body = Message_Body;
            SmtpClient Client = new SmtpClient();

            Client.Host = ConfigurationManager.AppSettings["smtphost"];
            Client.Port=25;

           try
            {
                Client.Send(smail);
            }
            catch
            {
                return false;
            }
            return true;
        }

Am working on plesk panel it works .

Hope this helps.



Regards

Babu Naresh Narra

Remember to click ?Mark as Answer? on the post If you get answer from my post(s) !
3 Items, 1 Pages 1 |< << Go >> >|




   
  Privacy | Contact Us
All Times Are GMT