Print Page | Close Window

E-mail form error

Printed From: Web Wiz Forums
Category: Web Wiz Hosting Services Forums
Forum Name: Web Wiz Hosting Support Forums
Forum Description: Support forum for Web Wiz Hosting services and solutions.
URL: https://forums.webwiz.net/forum_posts.asp?TID=29208
Printed Date: 29 March 2026 at 3:12am
Software Version: Web Wiz Forums 12.08 - https://www.webwizforums.com


Topic: E-mail form error
Posted By: shanerobinson
Subject: E-mail form error
Date Posted: 25 March 2011 at 4:34pm
I have created a form which gets sent to me via email on my website. I have set the sender dynamically as discussed in an earlier post and this works when i use any email address thats on my hosting package but comes up with the following error if i use an email address not on my account:

error '8004020f'

The code is below:

<%
If Request.Form("submit") = "Send Message" Then

Dim ObjSendMail
Dim strUserEmail
strUserEmail = Request.Form("emailx")
Set ObjSendMail = CreateObject("CDO.Message")
   

ObjSendMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
ObjSendMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpserver") ="mail.********.com"
ObjSendMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25
ObjSendMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpusessl") = False
ObjSendMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout") = 60
   

ObjSendMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = 1
ObjSendMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/sendusername") ="****@********.com"
ObjSendMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/sendpassword") ="************"
   
ObjSendMail.Configuration.Fields.Update
       
ObjSendMail.To = "*******@******.com"
ObjSendMail.Subject = "Contact Requested"
ObjSendMail.From = strUserEmail
   
ObjSendMail.TextBody = "  Name:  " & Request.Form("name") &"  E Mail:  "& Request.Form("emailx") &"  Subject:  "& Request.Form("subject") &"   Date/Time:  "& Request.Form("datex") &"  Question/Query:  "& Request.Form("question")
   
ObjSendMail.Send
   
Set ObjSendMail = Nothing

End if
%>



Replies:
Posted By: WebWiz-Bruce
Date Posted: 25 March 2011 at 4:41pm
The page below should help with your settings:-

http://www.webwiz.net/kb/web-hosting/sending-web-mail.htm - http://www.webwiz.net/kb/web-hosting/sending-web-mail.htm

Also make sure that your password is correct, if you update the password in your control panel make sure you check the 'update password' checkbox as well or the password will not be updated.


-------------
https://www.webwiz.net/web-wiz-forums/forum-hosting.htm" rel="nofollow - Web Wiz Forums Hosting
https://www.webwiz.net/web-hosting/windows-web-hosting.htm" rel="nofollow - ASP.NET Web Hosting


Posted By: shanerobinson
Date Posted: 25 March 2011 at 4:48pm

Hi Bruce,

The problem is i'm trying to set the 'From' email dynamically to whatever the visitor enters into the form field, but because the server seemd to use this for authentication it only works if i use an emial account from one in my control panel. Maybe the 'From' email account cannot be dynamic and entered by the visitor? I want to be able to recieve e-mails and be able to click on the reply option within my e-mail client and it automatically replies to the address the user has entered.

Regards,

Shane


Posted By: WebWiz-Bruce
Date Posted: 25 March 2011 at 4:59pm
To dynamically set the 'From' email address you need to send to a local mailbox created in your Control Panel.

You can setup Mailboxes to forward to another mailbox in your Control Panel if you need the email to be delivered to a non local mailbox.


-------------
https://www.webwiz.net/web-wiz-forums/forum-hosting.htm" rel="nofollow - Web Wiz Forums Hosting
https://www.webwiz.net/web-hosting/windows-web-hosting.htm" rel="nofollow - ASP.NET Web Hosting


Posted By: shanerobinson
Date Posted: 25 March 2011 at 5:38pm
now that i have set the 'To' command to a mail box on the server it works fine,

Thanks...



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.08 - https://www.webwizforums.com
Copyright ©2001-2026 Web Wiz Ltd. - https://www.webwiz.net