ASP.NET Scripting
PHP vs ASP.NET
PHP and ASP.NET are the two main scripting languages used by web developers.
PHP is a multi-platform open-source language whilst ASP.NET is a single platform language built and owned by Microsoft. Both of these languages are packed full of features and add-ons are available for both of these languages, so that you are able to extend their framework to build feature rich applications.
PHP
PHP is a language which has been around since 1984 and powers many of the world’s websites. It is free and is known as ‘open source’ software meaning that its source code is available for download, at no cost. It widely used in conjunction with the MySQL database engine.
PHP is a dynamic language since there are several different types of database that you are able to connect to. You are also able to edit the source of the language if you wish to speed it up or install custom modifications so that it is able to run as per your requirements.
ASP.NET
ASP.NET is a language based on the ASP - both languages are owned and were created by Microsoft. Although it is a free language, it isn’t open source meaning that you are unable to view or edit the source code of it. Also, it is very limited in what database types you can use with it.
ASP, ASP.NET’s forefather, was created back in the mid-1990s and is the base which ASP.NET has been built on. One thing which annoys many ASP.NET developers is the fact that Microsoft is forever releasing updates to the system, and in its course, changing things along the way meaning that in some cases, developers have to keep on learning the changes as well as the new components and functions which are being added.
Sending E-mail From ASP.NET (Version 2.0+)
ASP.NET is Microsoft’s revolutionary web application technology. ASP.NET has many features built in which other web language frameworks don’t support.
1) Import the mail namespace into the page.
2) Create the sub-routine that will send the email.
Sub SendEmail (ByVal Sender As Object, ByVal e As EventArgs)
End Sub
To send the mail on page load use the follow sub-routine.
Sub PageLoad(ByVal Sender As Object, ByVal e As EventArgs)
End Sub
All sub-routines must be surrounded by the following tags.
3) Declare the appropriate variables.
Dim msg As MailMessage = new MailMessage()
Dim smtp As New SmtpClient(”smtp.yourdomain.com”)
4) Start adding the appropriate details.
msg.From = new MailAddress(”from@yourdomain.com” ,“From Person”)
msg.To.Add(new MailAddress(”recipient@domain.com”, “Recipient”))
msg.IsBodyHtml = “False”,
‘Set this to “True” if the message body will be HTML.
msg.Body = “Email Body”
msg.Subject = “The Subject”
5) Send the email.
smtp.Send(msg) |