Could anybody please, help in converting the following few lines to C#???
Public Sub Send_Email2(ByVal claimID As Integer, ByVal ApartmentID As Integer, ByVal strComplaintTitle As String, ByVal strFullName As String, ByVal strPriority As String, ByVal strProblemDetails As String)
Dim UNMtxt As String = "
[email protected]"
Try
Dim varMailbody As String
varMailbody = "<b>Dear Admin,</b><br><br>"
varMailbody = varMailbody & "You got a new ticket."
varMailbody = varMailbody & "<b>Ticket Number: </b>" & claimID & "<b> Customer Name: </b>" & strFullName & "<br>"
varMailbody = varMailbody & "<br><b>Problem Title: </b>" & strComplaintTitle & "<b> Priority: " & strPriority & "</b><br>"
varMailbody = varMailbody & "<br><b>Problem Details: </b>" & strProblemDetails & "<br><br>Please check and reply.<br><br>Thank you<br>albab.com<br>"
Dim ToAddress As String = UNMtxt
Dim fromAddress As String = "
[email protected]"
'(1) Create the MailMessage instance
Dim mm As New MailMessage(fromAddress, ToAddress)
'(1.2) set the e-mail Priority
mm.Priority = CInt(DropDownList1.SelectedValue)
'(2) Assign the MailMessage's properties
mm.Subject = "New Ticket - albab.com"
mm.Body = varMailbody
mm.IsBodyHtml = True
'(3) Create the SmtpClient object
Dim smtp As New SmtpClient
'smtp.Host = "mail.albab.com"
smtp.Host = "LOCALHOST"
smtp.Port = 25
smtp.Credentials = New NetworkCredential("
[email protected]", "Sys!234")
'(4) Send the MailMessage (will use the Web.config settings)
smtp.Send(mm)
Response.redirect("~/OrderCompleted.aspx");
findlastTicketno()
Catch ex As Exception
Errlbl.Text = "Sorry! Your ticket can not be submitted at the moment!"
Errlbl.Text = Errlbl.Text & " " & ex.Message
End Try
End Sub