E Mail dynamic sender address
Printed From: Web Wiz Forums
Category: General Discussion
Forum Name: Classic ASP Discussion
Forum Description: Discussion on Active Server Pages (Classic ASP).
URL: https://forums.webwiz.net/forum_posts.asp?TID=28825
Printed Date: 28 March 2026 at 10:33pm Software Version: Web Wiz Forums 12.08 - https://www.webwizforums.com
Topic: E Mail dynamic sender address
Posted By: shane2121
Subject: E Mail dynamic sender address
Date 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 %>
|
Replies:
Posted By: 123Simples
Date 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
------------- http://www.123simples.com/" rel="nofollow - Visit 123 Simples Web Design
|
|