p2p.wrox.com Forums

p2p.wrox.com Forums (http://p2p.wrox.com/index.php)
-   ASP.NET 2.0 Professional (http://p2p.wrox.com/forumdisplay.php?f=215)
-   -   help, converting vb.net few lines to C# (http://p2p.wrox.com/showthread.php?t=54894)

nesrine March 5th, 2007 06:05 AM

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"


                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)



            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

dparsons March 5th, 2007 07:10 AM

Do a google search for VB to C# converter

================================================== =========
Read this if you want to know how to get a correct reply for your question:
^^Took that from planoie's profile^^
^^Modified text taken from gbianchi profile^^
================================================== =========
Technical Editor for: Professional Search Engine Optimization with ASP.NET
================================================== =========
Why can't Programmers, program??
================================================== =========

All times are GMT -4. The time now is 05:04 PM.

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.