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 bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

cfmail to addresses

Status
Not open for further replies.

jmeddes

IS-IT--Management
May 8, 2000
1
GB
I may have totally got the wrong idea about CFMAIL, but I’m having loads of problems setting the &quot;from&quot; and &quot;to&quot; addresses when including a real name. For example, the e-mail address,<br><br><A HREF="mailto:jm@xxx.com">jm@xxx.com</A><br><br>is okay, but when I try to include a real name it doesn’t get sent,<br><br>Jon &lt;<A HREF="mailto:jm@xxx.com">jm@xxx.com</A>&gt;<br><br>I’ve tried escaped quotes around Jon and various other things but I’m loathed to spend any more time on this if it just can’t be done, but I find this very surprising.<br><br>What is more inconvenient, is that CFPOP returns real names with the e-mail addresses, and I would have to do various bits of parsing to get the e-mail addresses – does anyone know any good ones?<br><br>Also, how can I send to more than one e-mail address, is it just semi-colons?<br><br>Thanks,<br><br>Jonathan<br>
 
I know the latest version of CFServer (ie. version 4.5.1 with service pack 2) doesn't mind email addresses of that form &quot;Name&quot; <emailaddress> .

This changed somewhere between version 4.0 and the current version.

a simple way of getting around this is to use regular expressions:

<cfif REFindNoCase('&quot;[^&quot;]*&quot; <[^>]*>',FromAddress,1) is not 0>
<cfset emailAddr = REReplaceNoCase(FromAddress,'&quot;[^&quot;]*&quot; <([^>]*)>','\1')>
<cfelse>
<cfset emailAddr = FromAddress>
</cfif>

Sending more than one email address can be done using commas. This makes it really easy if you want to use the results from a query:

<cfset toAddr = ValueList(queryname.fieldname)>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top