473,794 Members | 3,056 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

CDO, ASP and Email Form Problems


How do I alter the follow asp code so the from field produces the a friendly
address
"Name <so*******@chan geme.com>"

Code is presently used.

<%
If Request.Form("b tnSend").Count 0 Then
Set objMessage = CreateObject("C DO.Message")
objMessage.Subj ect = Request.Form("s ubject")
objMessage.Send er = Request.Form("F rom")
objMessage.To = Request.Form("T o")
objMessage.Text Body = Request.Form("m essage")
objMessage.Conf iguration.Field s.Item _
("http://schemas.microso ft.com/cdo/configuration/sendusing") = 2
objMessage.Conf iguration.Field s.Item _
("http://schemas.microso ft.com/cdo/configuration/smtpserver") =
"mailserver "
objMessage.Conf iguration.Field s.Item _
("http://schemas.microso ft.com/cdo/configuration/smtpserverport" ) = 25
objMessage.Conf iguration.Field s.Update
objMessage.Send
Response.Redire ct("../thanks.htm")
End If
%>

<form action="contact .asp" method="post" name="sendEmail " class="content" >
<input type="hidden" name="subject" value="Enquiry from Web Site">
<input type="hidden" name="to"
value="en****** *@chaucer.sheff ield.sch.uk"/>
<table align="center" cellpadding="5" bordercolor="#0 00000"
class="content" >
<tr>
<td>Your Email Address</td>
<td><input name="From" type="text" class="content" size="53"
/></td>
</tr>
<tr>
<td valign="top"><d iv align="right">Y our Message</div></td>
<td><textarea name="message" cols="50" rows="6"
wrap="VIRTUAL" class="content" ></textarea>
</td>
</tr>
<tr>
<td colspan="2"><di v align="center">
<input name="Send" type="submit" />
</div></td>
</tr>
</table>
<div align="center"> </div>
<div align="center"> </div>
</form>

Thank you any help.

Steve

"privatenews.mi crosoft.com" wrote:
Try,

http://weblogs.asp.net/steveschofiel...ipt_2E00_.aspx

Thanks,

Steve Schofield
Microsoft MVP - IIS

"Steve Audus, Chaucer BEC, Sheffield UK"
<St************ *************** **@discussions. microsoft.comwr ote in message
news:10******** *************** ***********@mic rosoft.com...
I have successful setup email forms on our web site using CDO and ASP
scripting,
using this coding
http://www.ilopia.com/Articles/Windo...r2003/CDO.aspx

It is used on this page
http://www.chaucer.sheffield.sch.uk/about/contact.asp

The form works, but when the mail arrives it in the inbox, the senders
name
is not displayed, as it is not included in the form.

Only "From (Email Address)" and "Message" are included.

How do I add a name field, and maybe extra field to be included in the
message.

Thank you for any help.

Jun 27 '08 #1
5 2029
I don't think you can, I think its your email program that stores that info.
If you have this address in your contacts, it will use the friendly name.

"Steve Audus, Chaucer BEC, Sheffield UK"
<St************ *************** **@discussions. microsoft.comwr ote in message
news:20******** *************** ***********@mic rosoft.com...
>
How do I alter the follow asp code so the from field produces the a
friendly
address
"Name <so*******@chan geme.com>"

Code is presently used.

<%
If Request.Form("b tnSend").Count 0 Then
Set objMessage = CreateObject("C DO.Message")
objMessage.Subj ect = Request.Form("s ubject")
objMessage.Send er = Request.Form("F rom")
objMessage.To = Request.Form("T o")
objMessage.Text Body = Request.Form("m essage")
objMessage.Conf iguration.Field s.Item _
("http://schemas.microso ft.com/cdo/configuration/sendusing") = 2
objMessage.Conf iguration.Field s.Item _
("http://schemas.microso ft.com/cdo/configuration/smtpserver") =
"mailserver "
objMessage.Conf iguration.Field s.Item _
("http://schemas.microso ft.com/cdo/configuration/smtpserverport" ) = 25
objMessage.Conf iguration.Field s.Update
objMessage.Send
Response.Redire ct("../thanks.htm")
End If
%>

<form action="contact .asp" method="post" name="sendEmail " class="content" >
<input type="hidden" name="subject" value="Enquiry from Web
Site">
<input type="hidden" name="to"
value="en****** *@chaucer.sheff ield.sch.uk"/>
<table align="center" cellpadding="5" bordercolor="#0 00000"
class="content" >
<tr>
<td>Your Email Address</td>
<td><input name="From" type="text" class="content"
size="53"
/></td>
</tr>
<tr>
<td valign="top"><d iv align="right">Y our Message</div></td>
<td><textarea name="message" cols="50" rows="6"
wrap="VIRTUAL" class="content" ></textarea>
</td>
</tr>
<tr>
<td colspan="2"><di v align="center">
<input name="Send" type="submit" />
</div></td>
</tr>
</table>
<div align="center"> </div>
<div align="center"> </div>
</form>

Thank you any help.

Steve

"privatenews.mi crosoft.com" wrote:
>Try,

http://weblogs.asp.net/steveschofiel...ipt_2E00_.aspx

Thanks,

Steve Schofield
Microsoft MVP - IIS

"Steve Audus, Chaucer BEC, Sheffield UK"
<St*********** *************** ***@discussions .microsoft.comw rote in
message
news:10******* *************** ************@mi crosoft.com...
>I have successful setup email forms on our web site using CDO and ASP
scripting,
using this coding
http://www.ilopia.com/Articles/Windo...r2003/CDO.aspx

It is used on this page
http://www.chaucer.sheffield.sch.uk/about/contact.asp

The form works, but when the mail arrives it in the inbox, the senders
name
is not displayed, as it is not included in the form.

Only "From (Email Address)" and "Message" are included.

How do I add a name field, and maybe extra field to be included in the
message.

Thank you for any help.


Jun 27 '08 #2

<Steve Audus>; <Chaucer BEC>; "Sheffield UK"
<St************ *************** **@discussions. microsoft.comwr ote in message
news:20******** *************** ***********@mic rosoft.com...
>
How do I alter the follow asp code so the from field produces the a
friendly
address
"Name <so*******@chan geme.com>"
The only thing you could do is add another input for the user to enter their
name.
You can then assignt the From field with:-

..From = Request.Form("n ame") & "<" & Request.Form("e mail") & ">"

--
Anthony Jones - MVP ASP/ASP.NET
Jun 27 '08 #3
That would work, but I am not very experienced with asp.

I tried but the page isn't working now, please advise further.

<%
If Request.Form("b tnSend").Count 0 Then
Set objMessage = CreateObject("C DO.Message")
objMessage.Subj ect = Request.Form("s ubject")

objMessage.Send er = Request.Form("F rom = Request.Form("n ame") & "<" &
Request.Form("e mail") & ">")

objMessage.To = Request.Form("T o")
objMessage.Text Body = Request.Form("m essage")
objMessage.Conf iguration.Field s.Item _
("http://schemas.microso ft.com/cdo/configuration/sendusing") = 2
objMessage.Conf iguration.Field s.Item _
("http://schemas.microso ft.com/cdo/configuration/smtpserver") =
"mailserver "
objMessage.Conf iguration.Field s.Item _
("http://schemas.microso ft.com/cdo/configuration/smtpserverport" ) = 25
objMessage.Conf iguration.Field s.Update
objMessage.Send
Response.Redire ct("../thanks.htm")
End If
%>

Thank you for any help

Steve

"Anthony Jones" wrote:
>
<Steve Audus>; <Chaucer BEC>; "Sheffield UK"
<St************ *************** **@discussions. microsoft.comwr ote in message
news:20******** *************** ***********@mic rosoft.com...

How do I alter the follow asp code so the from field produces the a
friendly
address
"Name <so*******@chan geme.com>"

The only thing you could do is add another input for the user to enter their
name.
You can then assignt the From field with:-

..From = Request.Form("n ame") & "<" & Request.Form("e mail") & ">"

--
Anthony Jones - MVP ASP/ASP.NET
Jun 27 '08 #4

<Steve Audus>; <Chaucer BEC>; "Sheffield UK"
<St************ *************** **@discussions. microsoft.comwr ote in message
news:85******** *************** ***********@mic rosoft.com...
That would work, but I am not very experienced with asp.

I tried but the page isn't working now, please advise further.

<%
If Request.Form("b tnSend").Count 0 Then
Set objMessage = CreateObject("C DO.Message")
objMessage.Subj ect = Request.Form("s ubject")

objMessage.Send er = Request.Form("F rom = Request.Form("n ame") & "<" &
Request.Form("e mail") & ">")

objMessage.To = Request.Form("T o")
objMessage.Text Body = Request.Form("m essage")
objMessage.Conf iguration.Field s.Item _
("http://schemas.microso ft.com/cdo/configuration/sendusing") = 2
objMessage.Conf iguration.Field s.Item _
("http://schemas.microso ft.com/cdo/configuration/smtpserver") =
"mailserver "
objMessage.Conf iguration.Field s.Item _
("http://schemas.microso ft.com/cdo/configuration/smtpserverport" ) = 25
objMessage.Conf iguration.Field s.Update
objMessage.Send
Response.Redire ct("../thanks.htm")
End If
%>

Thank you for any help

This in your code:-

objMessage.Send er = Request.Form("F rom = Request.Form("n ame") & "<" &
Request.Form("e mail") & ">")

Should be this:-

objMessage.From = Request.Form("n ame") & "<" & Request.Form("e mail") & ">"

--
Anthony Jones - MVP ASP/ASP.NET
Jun 27 '08 #5
Spot on, Thank you Thank You Thank you.

"Anthony Jones" wrote:
>
<Steve Audus>; <Chaucer BEC>; "Sheffield UK"
<St************ *************** **@discussions. microsoft.comwr ote in message
news:85******** *************** ***********@mic rosoft.com...
That would work, but I am not very experienced with asp.

I tried but the page isn't working now, please advise further.

<%
If Request.Form("b tnSend").Count 0 Then
Set objMessage = CreateObject("C DO.Message")
objMessage.Subj ect = Request.Form("s ubject")

objMessage.Send er = Request.Form("F rom = Request.Form("n ame") & "<" &
Request.Form("e mail") & ">")

objMessage.To = Request.Form("T o")
objMessage.Text Body = Request.Form("m essage")
objMessage.Conf iguration.Field s.Item _
("http://schemas.microso ft.com/cdo/configuration/sendusing") = 2
objMessage.Conf iguration.Field s.Item _
("http://schemas.microso ft.com/cdo/configuration/smtpserver") =
"mailserver "
objMessage.Conf iguration.Field s.Item _
("http://schemas.microso ft.com/cdo/configuration/smtpserverport" ) = 25
objMessage.Conf iguration.Field s.Update
objMessage.Send
Response.Redire ct("../thanks.htm")
End If
%>

Thank you for any help


This in your code:-

objMessage.Send er = Request.Form("F rom = Request.Form("n ame") & "<" &
Request.Form("e mail") & ">")

Should be this:-

objMessage.From = Request.Form("n ame") & "<" & Request.Form("e mail") & ">"

--
Anthony Jones - MVP ASP/ASP.NET
Jun 27 '08 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
5961
by: Chuck Farah | last post by:
I am unsuccessfullly trying to display an outlook email from a vb web forms (.net) outlook 2002 #1. is it possible to use outlook client email from a web form using the outlook object model within vb .net for web forms? #2. If not what is recommended (SMTP has problems if the address are not correct). I also have used the Mailto: but am having problems passing the body with formating
88
12565
by: Mike | last post by:
Is there a way to determine what a user's default email client is? I read a post from 3 years ago that said no. I guess I'm hoping something has come along since then.
3
492
by: Chuck Farah | last post by:
I am unsuccessfullly trying to display an outlook email from a vb web forms (.net) outlook 2002 #1. is it possible to use outlook client email from a web form using the outlook object model within vb .net for web forms? #2. If not what is recommended (SMTP has problems if the address are not correct). I also have used the Mailto: but am having problems passing the body with formating
2
1278
by: Danny Smith | last post by:
Hi folks, I'm having problems with my PHP form handler. It used to work correctly, but now for some reason its not. I'm hoping someone here could take a look and tell me where I might have gone wrong. Just for background info, when I click submit the form sends okay, but when the email arrives in my inbox the $name value is non-existent - like nothing had been entered in the box on the web page form.
3
1672
by: dtvuser | last post by:
Hi, I'm new to PHP and seem to be having soom problems, I'm getting confused with all the different styles of script writing. I've created a PHP script to submit details to my email but the details don't forward. PHP is enabled on the windows server host site. I don't get any errors it just stays on the submit form. below is the scripts for the submit form and the sendmail form. Also how do you get validation to work with the scripts?
0
9519
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10435
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10213
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10163
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9037
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6779
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5563
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4113
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2920
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.