Reputation: 1
I want send Email using Asp.net3.5, c#.net. I am able to send it using smtp.gmail.com with my ID [email protected], but my client given there details to send from there Id. With that I am unable to send. Details looks different like .Ex. xxx.xxx.com not like smtp.gmail.com there is no SMTP word in that host name. Please help me, how to send Email?
Upvotes: 0
Views: 1519
Reputation: 5211
There are a lot of sites on the net which will give you explanation and code as to how you can send mails in asp.net 3.5. You just need to google a bit. I have listed some sites which might be helpful to you. Compare your code with the ones given on these sites and check where you have made a mistake. Also if you can post your code here then we would be in a better position to help you out.
http://www.c-sharpcorner.com/UploadFile/dchoksi/SendingMail02132007002923AM/SendingMail.aspx
http://www.dotnetcurry.com/ShowArticle.aspx?ID=65&AspxAutoDetectCookieSupport=1
http://www.eggheadcafe.com/articles/20030720.asp
http://jalpesh.blogspot.com/2009/07/sending-email-through.html
Regards,
Samar
Upvotes: 0
Reputation: 2796
instead of using smtp.gmail.com
use mail.XXX.com
, you will be able to sent mail.
Upvotes: 0
Reputation: 7248
System.Web.Mail.MailMessage message=new System.Web.Mail.MailMessage();
message.Fields.Add( "http://schemas.microsoft.com/cdo/configuration/smtpauthenticate",1 );
message.Fields.Add( "http://schemas.microsoft.com/cdo/configuration/sendusername","SmtpHostUserName" );
message.Fields.Add( "http://schemas.microsoft.com/cdo/configuration/sendpassword","SmtpHostPassword" );
message.From="from e-mail";
message.To="to e-mail";
message.Subject="Message Subject";
message.Body="Message Body";
System.Web.Mail.SmtpMail.SmtpServer="SMTP Server Address";
System.Web.Mail.SmtpMail.Send(message);
For More info check this
Upvotes: 2