Author: kingofthejungle | Posted on: 3/20/2010 10:09:48 AM | Views : 261

Hi
I have trouble sending mail out .. it comes with no errors, so hope some can see the problem .. thanks :-)
protected void Button1_Click(object sender, EventArgs e) { try { MailMessage msg = new MailMessage(txtFrom.Text, "gmail@gmail.com", txtSubject.Text, txtMessage.Text); if (string.IsNullOrEmpty(fileUpload.PostedFile.FileName)) { } else { msg.Attachments.Add(new Attachment(fileUpload.PostedFile.FileName)); } SmtpClient mySmtp = new SmtpClient("localhost", 25); mySmtp.Send(msg); lblResult.Text = "Mail Sent"; } catch (Exception ex) { ...

Go to the complete details ...