Wrox Programmer Forums
Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 2.0 > ASP.NET 2.0 Professional
| Search | Today's Posts | Mark Forums Read
ASP.NET 2.0 Professional If you are an experienced ASP.NET programmer, this is the forum for your 2.0 questions. Please also see the Visual Web Developer 2005 forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 2.0 Professional section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old March 5th, 2007, 06:05 AM
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

 
Old March 5th, 2007, 07:10 AM
Wrox Author
Points: 13,255, Level: 49
Points: 13,255, Level: 49 Points: 13,255, Level: 49 Points: 13,255, Level: 49
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Oct 2005
Location: Ohio, USA
Posts: 4,104
Thanks: 1
Thanked 64 Times in 64 Posts
Send a message via AIM to dparsons
Default

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:
http://www.catb.org/~esr/faqs/smart-questions.html
^^Took that from planoie's profile^^
^^Modified text taken from gbianchi profile^^
================================================== =========
Technical Editor for: Professional Search Engine Optimization with ASP.NET
http://www.wiley.com/WileyCDA/WileyT...470131470.html
================================================== =========
Why can't Programmers, program??
http://www.codinghorror.com/blog/archives/000781.html
================================================== =========




Similar Threads
Thread Thread Starter Forum Replies Last Post
help, converting vb.net few lines to C# nesrine C# 3 March 6th, 2007 10:43 AM
Datagrid scroll count (Lines) VB.NET 2003 peterasimpson VB.NET 4 November 24th, 2005 05:34 PM
Datagrid scroll count (Lines) VB.NET 2003 peterasimpson VB How-To 1 November 24th, 2005 12:33 AM
converting DTS package from VB 6 to VB .NET petroleo Pro VB Databases 0 August 18th, 2003 05:01 PM





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