Web Wiz - Solar Powered Eco Web Hosting

  New Posts New Posts RSS Feed - E-mail form error
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

E-mail form error

 Post Reply Post Reply
Author
shanerobinson View Drop Down
Newbie
Newbie


Joined: 21 August 2008
Status: Offline
Points: 17
Post Options Post Options   Thanks (0) Thanks(0)   Quote shanerobinson Quote  Post ReplyReply Direct Link To This Post Topic: E-mail form error
    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
%>
Back to Top
WebWiz-Bruce View Drop Down
Admin Group
Admin Group
Avatar
Web Wiz Developer

Joined: 03 September 2001
Location: Bournemouth
Status: Offline
Points: 9791
Post Options Post Options   Thanks (0) Thanks(0)   Quote WebWiz-Bruce Quote  Post ReplyReply Direct Link To This Post Posted: 25 March 2011 at 4:41pm
The page below should help with your settings:-


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.
Back to Top
shanerobinson View Drop Down
Newbie
Newbie


Joined: 21 August 2008
Status: Offline
Points: 17
Post Options Post Options   Thanks (0) Thanks(0)   Quote shanerobinson Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
WebWiz-Bruce View Drop Down
Admin Group
Admin Group
Avatar
Web Wiz Developer

Joined: 03 September 2001
Location: Bournemouth
Status: Offline
Points: 9791
Post Options Post Options   Thanks (0) Thanks(0)   Quote WebWiz-Bruce Quote  Post ReplyReply Direct Link To This Post 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.
Back to Top
shanerobinson View Drop Down
Newbie
Newbie


Joined: 21 August 2008
Status: Offline
Points: 17
Post Options Post Options   Thanks (0) Thanks(0)   Quote shanerobinson Quote  Post ReplyReply Direct Link To This Post 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...
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.07
Copyright ©2001-2024 Web Wiz Ltd.


Become a Fan on Facebook Follow us on X Connect with us on LinkedIn Web Wiz Blogs
About Web Wiz | Contact Web Wiz | Terms & Conditions | Cookies | Privacy Policy

Web Wiz is the trading name of Web Wiz Ltd. Company registration No. 05977755. Registered in England and Wales.
Registered office: Web Wiz Ltd, Unit 18, The Glenmore Centre, Fancy Road, Poole, Dorset, BH12 4FB, UK.

Prices exclude VAT unless otherwise stated. VAT No. GB988999105 - $, € prices shown as a guideline only.

Copyright ©2001-2024 Web Wiz Ltd. All rights reserved.