Click here to Skip to main content
15,891,607 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
In my asp.net application i want to send a mail with attachment ,and also want code for group mail


now my code is

C#
DataSet ds = new DataSet();
            MailMessage mail1 = new MailMessage();
            mail1.From = txtemail.Text;
            ds.ReadXml(Server.MapPath("~/Admin/xml/feedbackmail.xml"));
            mail1.To = ds.Tables[0].Rows[0][0].ToString();

            mail1.Body = "Sender : " + txtemail.Text + "\n" + "Name : " + txtname.Text + "\n" + "Phone : " + txtPhone.Text + "\n" + "\n" + "Sub:" + txtsubject.Text + "\n" + "Body :" + txtmsg.Text;
            SmtpMail.SmtpServer.Insert(0, "83.245.63.194");
            SmtpMail.Send(mail1);
            CleaContents();


pls help me very urgent
Posted
Updated 20-Oct-11 21:07pm
v4

1 solution

For sending an attachment have a look at this Sending an Email in C# with or without attachments: generic routine.[^]

To send the mail to multiple addresses use To.Add[^] to add more.
 
Share this answer
 
v2
Comments
Espen Harlinn 15-Oct-11 9:14am    
Excellent link :)
André Kraak 15-Oct-11 10:39am    
Thanks.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900