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
vallab rao
1.7k
8
16.8k
Send email through the proxy server?
Mar 24 2010 6:38 AM
Hi,
I m implementing an tool which sends mail to any id to any id but i can send the mail through the direct use SMTP server and username and password. But when it comes to through the proxy then it fails. Don't know what went wrong ?
Here is code i m written:
protected void btnSendMail(object sender, EventArgs e)
{
MailAddress from = new MailAddress(txtFrom.Text.ToString());
MailAddress To = new MailAddress(Ttxt.Text.ToString());
MailMessage mail = new MailMessage(from, To);
mail.Subject = txtSubject.Text.ToString();
mail.Body = Editor1.Content.ToString();
mail.IsBodyHtml = true;
SmtpClient cnt = new SmtpClient();
cnt.Host = SDomainName.Text.ToString();//domain.com
cnt.Port = 1080;//port
cnt.Credentials = new System.Net.NetworkCredential(from.ToString(),txtPass.Text.ToString()); //username,password
//SmtpMail.Send(mail);
cnt.EnableSsl = true;
try
{
cnt.Send(mail);
status.Text = "Mail sent successfully";
}
catch (Exception ex)
{
status.Text = ex.Message.ToString();
}
}
Please help in implementing the code.
Reply
Answers (
0
)
Send Message on selected System IP Address.
MidPointRounding for Math.Round() method in .Net Application