Web Wiz - Solar Powered Eco Web Hosting

  New Posts New Posts RSS Feed - E Mail dynamic sender address
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

E Mail dynamic sender address

 Post Reply Post Reply
Author
shane2121 View Drop Down
Newbie
Newbie


Joined: 20 May 2010
Status: Offline
Points: 5
Post Options Post Options   Thanks (0) Thanks(0)   Quote shane2121 Quote  Post ReplyReply Direct Link To This Post Topic: E Mail dynamic sender address
    Posted: 03 September 2010 at 3:32pm
Hi i'm using the following code to send me an e-mail from a form which all works fine, but i want to be able to dynamically set
ObjSendMail.From =
to takes it value from what is entered into the form. i have tried many different ways and i keep getting errors. Any ideas please?



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

Dim ObjSendMail
Set ObjSendMail = CreateObject("CDO.Message")
   
ObjSendMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2 'Send the message using the network (SMTP over the network).
ObjSendMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpserver") ="mail.iconicmediadesign.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 'Use SSL for the connection (True or False)
ObjSendMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout") = 60
   
' If your server requires outgoing authentication uncomment the lines bleow and use a valid email address and password.
ObjSendMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = 1 'basic (clear-text) authentication
ObjSendMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/sendusername") ="*******"
ObjSendMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/sendpassword") ="*******"
   
ObjSendMail.Configuration.Fields.Update
       
ObjSendMail.To = "me.com"
ObjSendMail.Subject = "Subject"
ObjSendMail.From = "me.com"
   
ObjSendMail.HTMLBody = "body text"

'ObjSendMail.TextBody = ""
   
ObjSendMail.Send
   
Set ObjSendMail = Nothing

End if
%>

Back to Top
123Simples View Drop Down
Senior Member
Senior Member
Avatar

Joined: 08 July 2007
Location: United Kingdom
Status: Offline
Points: 1192
Post Options Post Options   Thanks (0) Thanks(0)   Quote 123Simples Quote  Post ReplyReply Direct Link To This Post Posted: 03 September 2010 at 8:43pm
The code is a bit wrong. Say for example you have your contact form with the fields in it, then the processing side to bring that information from the form needs to pull in those fields.

A brief example since it is late would be:
objCDOSYSMail.HTMLBody = objCDOSYSMail.HTMLBody &"<br>E-Mail: " & request("email")


If you are really stuck then PM me and I'll see if I can have a look at your current form on the website you are using. It perhaps needs some tweaking
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.