Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Problem-Email group of recipients via link on ASP page 1

Status
Not open for further replies.

seagoing

Programmer
Jun 1, 2003
61
GB
Hi

Having a little difficulty with this, advice welcome.

I'm paging through a recordset and accumulating user names and corresponding email address from each record into a string variable which I then write to the asp page as part of a mailto: link.

I want the link to fire up the users desktop email client placing the list of Name/Email addresses in the To: box.

My understanding was that each entry in the mailto: link should be of the form...

Name <email_address>;

However, it seems that inclusion of the "<" character in the string results in only the first name being passed??

Here's the relevant bits of my code, anyone spot anything untoward?

Code:
do while not rsNSSA.eof
	'Build a string of Names and corresponding email addresses
	massEmail = massEmail & rsNSSA("m_firstname") & " " & rsNSSA("m_lastname") & " <" & rsNSSA("m_email") & ">; "
	rsNSSA.movenext
loop
if massEmail <> "" then
	'trim off trailing space and arbitrary last semi-colon
	massEmail = trim(massEmail)
	massEmail = left(massEmail, len(massEmail)-1)
	'Write link to asp page
	response.write "<a href='mailto:" & massEmail & "'>Email ALL Commitee Members with an Email Address</a>"
end if

Help appreciated
Regards
TS
 
You need to use the entity values:

&lt;
&gt;

Having said that, I would probably just forget about the real names and just concatenate the list of email addresses.

--James
 
Thanks for the tip, unfortunately it made NO difference.
I have not problem with the script just producing a list of email addresses, the problem I have is getting it to work with Names AND Email addresses, which is a requirement I have.

Any further ideas at all would be welcome

Regards
TS
 
You might try [square brackets] for the real names... Outlook likes 'em, anyway.
 
Thanks for the suggestion which didn't work in OEx, which I reckon is what most people use.

Interestingly, my original code, in first post, works with Outlook, but not outlook express?
 
If the real name has non-alphanumeric characters (like a period after an initial) you have to have the whole name in quotes. I'd say try quotes around the names and < and > around the email address.

I don't think you're necessarily going to find a format that works in the majority of email programs anyway. While IE is still the big winner in the browser category (though Firefox is certainly making headway), there's a ton of email apps, including AOL's, Netscape, Eudora, Thunderbird, and web mail apps that will catch mailtos (like Gmail with the Notifier, etc.).
 
Yep, I guess I agree, probably best to just stick with a list of standard email addresses

Thanks for the tips though

Regards
TS
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top