Page 1 of 1

Customize each mail sended since a distribution list

Posted: 2007-08-11 01:01
by JeromeBxl

I have a problem; I have configured a distribution list.
Now, when I send a message to the list, the mail is the same for all the subscribers.

I want to customize each message by adding the email address of the subscriber in a link in the body to give the possibility to do an unsubscribe online.

For that, I try to intercept each mail in the OnDeliverMessage event handler. I can only catch one mail in which the recipient collection contains the complete list of my subscribers, and not the individual recipient, as I need it.

I can’t intercept each mail individually to customize it.

Do you have any idea how this can be achieved?

Thanks in advance for your help,


Posted: 2007-08-11 02:13
by ^DooM^
I am not sure about your specific request but there are mailing list scripts in the user contributed scripts section here. ... ution+list

just do a search in that section if that script isn't what you are after.

Posted: 2007-08-11 18:47
by JeromeBxl

Thanks for your post. Unfortunatelly, this does not solve my problem. In the post you invited me to read, HMailServer reacts when he receives mails with commands as ‘subscribe, remove’.

This is not what I am looking for. I have a template of a newsletter that contains the following code:

<a href=unsubscribe.php?email=[EMAIL]>unsubscribe now</a>

And I want to replace the place holder [EMAIL] by the address email of the recipient.

The recipients are already subscribed.

Do you have any suggestions?

Thanks in advance,


Posted: 2007-08-21 14:36
by Thomas Parvais
nobody to help Jerome ?

Re: Customize each mail sended since a distribution list

Posted: 2013-03-03 01:22
by brother.gabriel
Ha ha! :lol: i'm about 9 years too late for this! However, I'll post a pseudo-solution in case anyone else comes here looking for answers.

First thing is to install the listserver script.

To do this, you need access to a webserver. Basically, you create a web page that has the ability to send an email. Then you insert the link to the webpage in your mailinglist_footer.html file. When the user clicks the link, the webpage is loaded and the user is told that they are unsubscribed.

You could insert a mailto link with the unscribe command in a hyperlink and put that in your footer.html file, but it will open in the user's email client rather than working automatically - but it works. All the user has to do is push send.

Code: Select all

<p style="color:gray size:8pt text-style:italic">You are subscribed to the mailing list: %address%.
<br />
<a href='mailto:%address%?subject=unsubscribe'>Click here to unsubscribe</a> (Just send the mail when it is composed).