Reply to topic
A Simple Email Script
PhillGibson


Joined: 01 Jun 2007
Posts: 2
Reply with quote
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


Joined: 17 Jun 2004
Posts: 34
Reply with quote
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
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
All times are GMT  
Page 1 of 1  

  
  
 Reply to topic