Help - Search - Members - Calendar
Full Version: Can't get ASPMail to work
Hostony Board > General Support > General Support
jackel
I can't seem to get aspmail to work. I used the sample you sent me but I still get this error:

Error occurred: 503 This mail server requires authentication when attempting to send to a non-local e-mail address. Please check your mail client settings or contact your administrator to verify that the domain or address is defined for this server.

Here is the text of the simple.asp file I am trying to use.

<%
' change to address of your own SMTP server
strHost = "mail.midga.com"
If Request("Send") <> "" Then
Set Mail = Server.CreateObject("Persits.MailSender")
' enter valid SMTP host
Mail.Host = strHost
Mail.From = Request("From") ' From address
Mail.FromName = Request("FromName") ' optional
Mail.AddAddress Request("To")
' message subject
Mail.Subject = Request("Subject")
' message body
Mail.Body = Request("Body")
strErr = ""
bSuccess = False
On Error Resume Next ' catch errors
Mail.Send ' send message
If Err <> 0 Then ' error occurred
strErr = Err.Description
else
bSuccess = True
End If
End If
%>
<HTML>
<BODY BGCOLOR="#FFFFFF">
<% If strErr <> "" Then %>
<h3>Error occurred: <% = strErr %>
<% End If %>
<% If bSuccess Then %>
Success! Message sent to <% = Request("To") %>.
<% End If %>
<FORM METHOD="POST" ACTION="Simple.asp">
<TABLE CELLSPACING=0 CELLPADDING=2 BGCOLOR="#E0E0E0">
<TR>
<TD>Host (change as necessary in script):</TD>
<TD><B><% = strHost %></B></TD>
</TR>
<TR>
<TD>From (enter sender's address):</TD>
<TD><INPUT TYPE="TEXT" NAME="From"></TD>
</TR>
<TR>
<TD>FromName (optional, enter sender's name):</TD>
<TD><INPUT TYPE="TEXT" NAME="FromName"></TD>
</TR>
<TR>
<TD>To: (enter one recipient's address):</TD>
<TD><INPUT TYPE="TEXT" NAME="To"></TD>
</TR>
<TR>
<TD>Subject:</TD>
<TD><INPUT TYPE="TEXT" NAME="Subject"></TD>
</TR>
<TR>
<TD>Body:</TD>
<TD><TEXTAREA NAME="Body"></TEXTAREA></TD>
</TR>
<TR>
<TD COLSPAN=2><INPUT TYPE="SUBMIT" NAME="Send" VALUE="Send Message">
</TD>
</TR>
</TABLE>
</FORM>
</BODY>
</HTML>
lepaul36
you need to include user name and pass word. Here is a routine that I use, just change username@domain, pasword, and yourmailserver with your info.

Public Sub SendMail(ByVal Message As String, ByVal ToAddy As String, ByVal FromAddy As String, ByVal Subject As String)
Dim email As New MailMessage
With email
.To = ToAddy
.From = FromAddy
.BodyFormat = MailFormat.Text
.Subject = Subject
.Body = Message
.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate", "1") 'basic authentication
.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendusername", "UserName@domain.com") 'set your username here
.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendpassword", "password") 'set your password here
SmtpMail.SmtpServer = "yourmailserver" 'your real server goes here
SmtpMail.Send(email)
End With
End Sub
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2024 Invision Power Services, Inc.
IPS Driver Error

IPS Driver Error

There appears to be an error with the database.
You can try to refresh the page by clicking here