Control Panel
Forum
Hosting Help
ASP.NET 4 & SQL 2008 R2 Hosting
Resources
Notice
Login
Members
Shared Hosting
|
Upgrade
|
Advertise
|
Tutorials
|
AdSense revenue sharing sites
|
Exam 70-680 Practice Tests
|
Silverlight games
Total
members
:
210363
Average new registrations per day (in last 7 days):
16
New Registration:
Open
Register Now
Home
»
Questions & Answers
»
mail sending problem...need help urgently
mail sending problem...need help urgently
4/6/2010
Author:
Farzana Rashid
http://aspspider.info/farzanarashid
Test Website Farzana
hello fellows,
my site is made in asp.net 3.5 ,visaul studio 2008.I have uploaded my webstie on server but the mails are not being send to the customers.No error is generated ...code works smooth but the mails are not been received by the customer...my code is given below...please help i have already crossed a deadline.
//////////////////////////////
SmtpClient client = new SmtpClient();
client.Host = smtp.richwholesaleorders.com;
client.Port = 25;
client.UseDefaultCredentials = true;
MailAddress sendfrom = new MailAddress(info@richwholesale.com);
MailAddress sendto = new MailAddress(farzana_naseer@yahoo.com);
MailMessage message = new MailMessage(sendfrom, sendto);
message.Subject = Order Received;
///// Message Body
StringBuilder msgbody = new StringBuilder();
msgbody.Append(Thankyou for Ordering from Richmond Wholesale.Your Order Number:);
msgbody.Append(oid);
msgbody.Append( has been accepted and will be delivered shortly );
msgbody.Append(Environment.NewLine);
msgbody.Append(Thankyou for your business with RichmondWholesale.);
client.Send(message);
/////////////////////////////
do i need email address of the mail server i am using or any email address will work????
Answers .............
Author:
Farzana Rashid
Posted Date: 4/6/2010
http://aspspider.info/farzanarashid
Test Website Farzana
sorry the mail server is mail.richwholesaleorders.com
Author:
Ben Ritter
Illinois State University
Posted Date: 4/6/2010
The way I ended up implementing email was by using a gmail account as an smtp server. If you google that you can find some helpful tutorials but here's the code that worked for me.
using System.Net.Mail;
using System.Net.Mime;
using System.Threading;
using System.ComponentModel;
MailMessage mail = new MailMessage();
mail.To.Add(customer@email.com);
mail.From = new MailAddress(from@website.com);
mail.Subject = Email Subject;
string Body = Main message;
mail.Body = Body;
mail.IsBodyHtml = true;
SmtpClient smtp = new SmtpClient();
smtp.Host = smtp.gmail.com;
smtp.Port = 587;
smtp.Credentials = new System.Net.NetworkCredential
(your_login@gmail.com, your_password);
smtp.EnableSsl = true;
smtp.Send(mail);
Author:
Ben Ritter
Illinois State University
Posted Date: 4/6/2010
those parameters are all strings, by the way, but they didn't show up for some reason.
You must
login
to post answer for this question.
Advertise
Privacy Policy
Terms of use
Contact Us
SpiderWorks Technologies Pvt Ltd.
All Rights Reserved.