Forum Moderators: open

Message Too Old, No Replies

Mail merge with Jmail

How to substitute names in HTML email

         

aspdaddy

8:50 am on Sep 12, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Has anyone done a mail-merge using an asp mail component?

Is there a way to substitue the values in the body once the template is attached like this -

JMail.AppendBodyFromFile( Server.MapPath("/myMailTemplate.htm" ))

Or with aspmail/cdonts

plumsauce

10:08 am on Sep 12, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member




why don't you try using server.execute() of a file
that only sets a string variable with the value of
the body template contents. then do a string.replace()
of variables like ##name##, ##date##, etc. with the
desired values.

that is, if jmail lets you set the body from a variable.
most components do.

i suggest this only because i avoid the filesystem object
at all costs.

+++

txbakers

1:24 pm on Sep 12, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I have to agree, when I create my mail with ASP I do it all in the component. that way I can I can do many more things dynamically.

aspdaddy

2:33 pm on Sep 12, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



This is what I am trying to achieve -

online html emailer that accept
1- HTML templates with embedded merge fields
2 -Excel files of names,emails & other merge fields e.g voucher codes.

The way I figure, it will have to use a loop so that each mail is customised - BCC not an option. I will need to replace texts in an html file or directly in the message body.

Do you know which of the asp mail componets would best for this? (Jmail/CDO/ASPMail)