I don't know exactly what you are trying to do.
Were did you place your ASP.NET code?
500 Internal Server Error pops up when it's not properly placed in the BIN folder.
This part of the code:
private void SendEmail()
{
const string SERVER = "relay-hosting.secureserver.net";
MailMessage oMail = new System.Web.Mail.MailMessage();
oMail.From = "emailaddress@domainname";
oMail.To = "emailaddress@domainname";
oMail.Subject = "Test email subject";
oMail.BodyFormat = MailFormat.Html; // enumeration
oMail.Priority = MailPriority.High; // enumeration
oMail.Body = "Sent at: " + DateTime.Now;
SmtpMail.SmtpServer = SERVER;
SmtpMail.Send(oMail);
oMail = null; // free up resources
needs a closing bracket }
If you've wrtitten only this methode without declaring this method as a member of a class this will never work C# is compltely object oriƫntated. You cannot instanciate a method without a class..
Error 800402e
Looks like there is something wrong with the SMTP adres.
I allways use the web.config to setup the smtp.
Something like this:
<system.net>
<mailSettings>
<smtp from="">
<network host="127.0.0.1"
password="" userName="" />
</smtp>
</mailSettings>
</system.net>
ASP.NET is totally different to ASP. ASP.NET works with precompiled code. Is your IIS setup for ASP.NET?