I am basically looking for a solution to send a contact form over the web from a website written in asp.net without having to use smtp. This seems like it should be a simple task however it has grown into a complex issue, I should state that asp.net is not my preferred method for building the site so I am not very familiar with sending emails using it, I would have much rather built the site in php. Hosting company will not provide me the smtp server information and I do not have my own. Below is the code I am trying right now:
Sub Send2Mail (sender as Object, e as EventArgs)
Dim objMail as New MailMessage()
objMail.To = "email@email.com"
objMail.From = strEmail.Text
objMail.BodyFormat = MailFormat.Text
objMail.Priority = MailPriority.Normal
objMail.Subject = strSubject.Text
objMail.Body = "Name : " + strName.Text + vbNewLine + "Email : " + strEmail.text + vbnewLine + "Message : " + strYourMsg.text
SmtpMail.SmtpServer = "localhost"
SmtpMail.Send(objMail)
strMessage.Visible = true
End Sub
Is there any alternative to using the SMTP server?
Eventually you will need access to an SMTP server in order to send the actual email, even if it’s access via another SMTP host.
In the meantime you could store the data within a specific database table and have that checked regularly.
Initially this could be done manually, but once you have access to an SMTP server you could have the addition of new rows trigger an email.
One thing that you must protect against though is the use of bots accessing your contact page and using it to send spam mail or fill up you DB.