View Single Post
  #1 (permalink)  
Old March 5th, 2007, 06:05 AM
nesrine nesrine is offline
Authorized User
 
Join Date: Feb 2007
Location: , , .
Posts: 20
Thanks: 0
Thanked 0 Times in 0 Posts
Default help, converting vb.net few lines to C#

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 = "nesrine72@hotmail.com"

            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 = "nesrine1972@yahoo.com"

                '(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("nesrine1972@yahoo.com", "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