Tech
Forums
Jobs
Books
Events
Videos
Conference
Annual Conference
Bcrypt
Ai Conference
Live
More
Interviews
Certification
Training
Career
Members
News
Blogs
Contribute
An Article
A Blog
A Video
An Ebook
An Interview Question
Register
Login
2
Answers
How can i eliminate this error??
Ask a question
Ask a question
Upload Source Code:
Select only zip and rar file.
asif basha
15y
2.4k
1
Reply
MailMessage mail = new MailMessage();
mail.To = "
[email protected]
";
mail.From = "
[email protected]
";
mail.Subject = "this is a test email.";
mail.Body = "this is my test email body.";
MailAttachment attachment = new MailAttachment(Server.MapPath("somemail1.txt")); //create the attachment
mail.Attachments.Add(attachment); //add the attachment
SmtpMail.SmtpServer = "localhost"; //your real server goes here
SmtpMail.Send(mail);
While running this code Im gettin error saying:transport failed to connect to the server
Post
Reset
Cancel
Answers (
2
)
Next Recommended Forum
How to embed image which should be generated dynamically in a mail
How to unlock a dynamically generated assembly once I have used it from within main application?