Hello,
I am new to coding in vb.net and have run into an issue with some code
that I am looking over. This is a webform that is filled out and once
it is filled out, it takes the responses from the form and appends it
to an email which it then sends out to one specific user (for testing
purposes, it's sending to me). My problem is that the code somehow is
sending two identical emails to me. I am almost certain that the code
looks ok, and I have other applications written in vbscript that sends
to the same relay server and only sends out one email. Can anyone else
see why this might be happening?
Thanks in advance,
Sheel Shah
Society of Actuaries
Dim emailfrom As String = ""
Dim emailto As String = ""
Dim emailcc As String = ""
Dim emailsubject As String = ""
Dim attachmentfile As String = ""
Dim is_attached As Boolean = True
Dim save_filepath As String = ""
emailfrom =
System.Configuration.ConfigurationManager.AppSettings("ExpressionOfInterest_Email_From")
emailto = "ss...@soa.org"
emailsubject =
System.Configuration.ConfigurationManager.AppSettings("ExpressionOfInterest_Subject")
Dim message As System.Net.Mail.MailMessage
Dim emailClient As SmtpClient
Dim messageBody = msg.ToString()
Try
message = New MailMessage(emailfrom, emailto, "College
Listing Application Form", msg.ToString())
If (emailcc.ToString.Trim <> "") Then
message.CC.Add(emailcc)
End If
emailClient = New
SmtpClient(System.Configuration.ConfigurationManager.AppSettings("mail.server.name").ToString,
System.Configuration.ConfigurationManager.AppSettings("mail.server.port"))
emailClient.Send(message)
lblerrmsg.text = "Your College Listing Application
Form has been successfully sent."
confirmation.Visible = True
MainForm.Visible = False
Catch ex As Exception
lblerrmsg.Text = "Your Form is not Submitted.
Please contact web Administrator for this Error."
confirmation.Visible = False
MainForm.Visible = True
Finally
End Try
Thanks,
Sheel
I am new to coding in vb.net and have run into an issue with some code
that I am looking over. This is a webform that is filled out and once
it is filled out, it takes the responses from the form and appends it
to an email which it then sends out to one specific user (for testing
purposes, it's sending to me). My problem is that the code somehow is
sending two identical emails to me. I am almost certain that the code
looks ok, and I have other applications written in vbscript that sends
to the same relay server and only sends out one email. Can anyone else
see why this might be happening?
Thanks in advance,
Sheel Shah
Society of Actuaries
Dim emailfrom As String = ""
Dim emailto As String = ""
Dim emailcc As String = ""
Dim emailsubject As String = ""
Dim attachmentfile As String = ""
Dim is_attached As Boolean = True
Dim save_filepath As String = ""
emailfrom =
System.Configuration.ConfigurationManager.AppSettings("ExpressionOfInterest_Email_From")
emailto = "ss...@soa.org"
emailsubject =
System.Configuration.ConfigurationManager.AppSettings("ExpressionOfInterest_Subject")
Dim message As System.Net.Mail.MailMessage
Dim emailClient As SmtpClient
Dim messageBody = msg.ToString()
Try
message = New MailMessage(emailfrom, emailto, "College
Listing Application Form", msg.ToString())
If (emailcc.ToString.Trim <> "") Then
message.CC.Add(emailcc)
End If
emailClient = New
SmtpClient(System.Configuration.ConfigurationManager.AppSettings("mail.server.name").ToString,
System.Configuration.ConfigurationManager.AppSettings("mail.server.port"))
emailClient.Send(message)
lblerrmsg.text = "Your College Listing Application
Form has been successfully sent."
confirmation.Visible = True
MainForm.Visible = False
Catch ex As Exception
lblerrmsg.Text = "Your Form is not Submitted.
Please contact web Administrator for this Error."
confirmation.Visible = False
MainForm.Visible = True
Finally
End Try
Thanks,
Sheel