TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
jaypee bacol
NA
67
0
email just stored in C:\Inetpub\mailroot\Queue and not being sent
Jan 8 2010 10:53 PM
Hi All,
I created web appliction to send email using
SmtpClient()
and
MailMessage()
objects. When I clicked the button, the message was sent successfully and it just goes to C:\Inetpub\mailroot\Queue directory. Please help me on how to solve this. I am thinking this related to IIS issue? Below is my code.
SmtpClient
smtpClient =
new
SmtpClient
();
MailMessage
message =
new
MailMessage
();
try
{
MailAddress
fromAddress =
new
MailAddress
(txtFrom.Text, txtFrom.Text);
MailAddress
toAddress =
new
MailAddress
(txtTo.Text);
smtpClient.Host =
"localhost"
;
smtpClient.Port = 25;
message.From = fromAddress;
message.To.Add(toAddress);
message.Subject =
"Feedback"
;
message.IsBodyHtml =
false
;
message.Body = txtMessage.Text;
message.Priority =
MailPriority
.High;
smtpClient.Send(message);
lblResult.Text =
"Email successfully sent."
;
}
catch
(
Exception
ex)
{
lblResult.Text =
"Send Email Failed."
+ ex.Message;
}
Thanks,
Reply
Answers (
3
)
Hyperlink in event log
How to fetch records from database ?