![]() |
| A Simple Email Script |
|
PhillGibson
|
Hi,
Can anyone tell me why this isn't working. It's a simple email page, but it doesn't actually email anything and it doesn't return any errors, either. I think I've got the 'From', 'To', and 'SmtpServer' values right as per HostMySite Support. There's really not much else that I can see that can be going wrong. This is a modified script from asp101.com, BTW. <%@ Page Language="VB" ClientTarget="downlevel" ContentType="text/html" ResponseEncoding="iso-8859-1" %> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <%@ Import Namespace="System.Web.Mail" %> <script language="VB" runat="server"> Sub btnSendMail_OnClick(Source As Object, E As EventArgs) Dim myMessage As New MailMessage Dim myMail As SmtpMail myMessage.From = "root@mywebsite.com" myMessage.To = "my@email.net" myMessage.Subject = "A Test Message" myMessage.Body = "Test Message" myMail.SmtpServer = "mail56.safesecureweb.com" myMail.Send(myMessage) End Sub </script> Finished. Thanks! Phill Gibson pgibson@hiwaay.net |
||||||||||||
|
|
|||||||||||||
|
rj
|
I tried out this script myself and I had no luck either. If you try the script found here:
http://hostmysite.com/support/programming/aspmail/ Does email work for this? If not then the problem may be with the configuration of either your site in IIS or something between the webserver and the email server authtenticating correctly. |
||||||||||||
|
|
|||||||||||||
| A Simple Email Script |
|
||
|


