Click here to Skip to main content
15,881,281 members

Comments by baskaran chellasamy (Top 145 by date)

baskaran chellasamy 30-Dec-13 3:54am View    
sorry. from address is dynamic email address that has typed by some of visitor of web page. so i cannot set any default address as a from address. In contact us page any visitor can come and will send their enquiry to the owner of the website.
baskaran chellasamy 30-Dec-13 3:14am View    
ok this is my code. but from address is info@dhuvara.com
try
{
MailMessage Msg = new MailMessage();
// Sender e-mail address.
Msg.From = new MailAddress(txtEmail.Text);
// Recipient e-mail address.
Msg.To.Add("info@chapatimakingmachine.org");
Msg.Subject = txtEmail.Text;

// string message = PopulateBody(txtName.Text,txtphone.Text,txtEmail.Text,txtMessage.Text);
Msg.Body = "<html><body><Table><tr><td>Name :</td><td>" + txtName.Text + "</td></tr><tr><td>Phone Number :</td><td>" + txtphone.Text + "</td></tr><tr><td>Email Addresss :</td><td>" + txtEmail.Text + "</td></tr><tr><td>Booking Category :</td><td>" + Bookingcategordropdown.SelectedItem.Text + " </td></tr><tr><td> Message :</td><td>" + txtMessage.Text + "</td></tr></Table></body></html><html><body>";
Msg.CC.Add("sundhar@chapatimakingmachine.org");
Msg.CC.Add(txtEmail.Text);
Msg.IsBodyHtml = true;
// your remote SMTP server IP.
SmtpClient smtp = new SmtpClient();
smtp.Host = "smtp.live.com";
smtp.Port = 587;
Msg.Priority = MailPriority.Normal;
smtp.UseDefaultCredentials = false;
smtp.Credentials = new System.Net.NetworkCredential("info@dhuvara.com", "SolaiMail");
smtp.EnableSsl = true;
// smtp.Send(txtEmail, "info@dhuvara.com", txtEmail.Text, body);
smtp.Send(Msg);
//Msg = null;
lbltxt.Text = "Thanks for Contact us";
// Clear the textbox valuess
txtName.Text = "";
// txtSubject.Text = "";
txtMessage.Text = "";
txtEmail.Text = "";
}
catch (Exception ex)
{
Console.WriteLine("{0} Exception caught.", ex.ToString());
}
baskaran chellasamy 26-Dec-13 5:05am View    
No error through in code while in server. but i does not send a mail.
www.dhuvara.com/sub/asp/Default3.aspx this is the page.
baskaran chellasamy 24-Dec-13 15:22pm View    
thank you.
baskaran chellasamy 24-Dec-13 15:11pm View    
i have deployed my site in windows webserver that is i purchased from webhost provider near from me. In this situation whether i need to use IIS server? because i deployed my site using visual studio 2010 copy website tool to ftp server.