Return to the Xequte Home Page  
Products       Store       Support       User Discussion       Contact Us      
 

Integrating MailList King with your Web Site


 

Introduction

Allowing users to join/leave your mailing list from a web page is relatively simple to setup, as most web servers offer a formmail or sendmail script which will send the output of a web form to you as an e-mail.  So you only need to ensure that the submission e-mail is sent in a format that MailList King can understand.

For normal processing by MailList King an email need only have the subject "SUBSCRIBE" (or "UNSUBSCRIBE") with the reply address pointing to the e-mail to add to the list.

Alternatively you can put the e-mail address to add in the subject line, e.g. SUBSCRIBE john@abc.com.  And you may also want to specify the group that the user wants to join, e.g. SUBSCRIBE john@abc.com Some_Group.

This is generally quite easy to do with web site e-mail scripts as you will see in the examples below.  On our web site we offer a mailing list sign up page as well as collecting e-mail addresses when users download their software - all of which goes directly to MailList King.

Of course, if you want to capture more information, such as the user's company or address, or for some reason you just can't change the formatting of messages sent by the server then you should use the 'Web Form Processing' function, under View>Options, Web Forms, which will parse the entire contents of a special web form message and it to your database.

Return to Index   

 

A Simple Script

While the syntax used by the formmail script on web servers may differ, generally they use a field named "subject" as the subject of the submission e-mail, and a field named "email" as the reply address.  So the simplest solution is to have a text input to collect the email and a hidden field specifying the subject as "Subscribe".

<input TYPE="hidden" NAME="subject" value="Subscribe">
<input type="text" name="email" maxlength="60">

Which might look like this...

E-mail:

The complete source of which is:

Return to Index   

 

Handling Group Selection

Of course, you may well have various groups in your mailing list (we have one for each of our products) and so want to allow the user to select which group to join.

The process is the same as above, but now we need to be able to change the subject based on the user's selection.  To do this we remove the hidden "Subject" field and use a "Select" input and give that the name, "Subject".  You will see that the trick is that we set the value to include the word SUBSCRIBE followed by the group name, which will then become the subject of the e-mail.

For example:

<select name="Subject">
    <option value="SUBSCRIBE MAILLIST_KING">MailList King</option>
    <option value="SUBSCRIBE DIJI_ALBUM">Diji Album</option>
</select>

So our form might now look like this...

Group:
E-mail:

The complete source of which is:

Return to Index   

 

Handling Multiple Groups

What if you want to allow a user to join a number of mailing lists at once?

From the perspective of a web form, and MailList King, this is simple.  As you only need to include multiple check boxes, all with the same name, and then each one that the user has checked will be seperated by a comma, and MailList King will add the user to each of the groups.

For example, let's say you have three groups in your mailing list, then you would have a check box for each on your sign-up page.

E.g.

<input type="checkbox" name="Group" value="MailList_King">MailList King
<BR><input type="checkbox" name="Group" value="Diji_Album">Diji Album
<BR><input type="checkbox" name="Group" value="MegaView">MegaView

Which would appear as:

MailList King
Diji Album
MegaView

Now if the user were to check the MegaView and Diji Album option, the form would process that as:
Group=Diji_Album,MegaView

Unfortunately we are now not able to use our trick to include the SUBSCRIBE command, so we would need to edit the formmail/sendmail script to directly control what is inserted into the message subject. This is not difficult on a Windows Server if you know a little ASP, see below, but an easier solution for most users in this situation will be to use the "Web Forms" function of MailList King to handle a custom formatted web submission message, as mentioned above.

A good tool for automatically generating web forms HTML is available at HTML Basix

Return to Index   


 
ASP on Windows Servers

Another alternative if your site runs on a Windows server is to create an ASP script to handle the form submission.  The ASP script language is reasonably simple if you have some programming experience.  Using ASP you will easily be able to build the complete subject of the submission e-mail.

I.e., The subject will contain the word SUBSCRIBE or UNSUBSCRIBE.  This will then be followed by the address to add, and finally, you can optionally add a group to add the user to (separating multiple groups with a comma). Please view our ASP script to see how we do it.

Here are some examples of valid subjects:

SUBSCRIBE john@abc.com
UNSUBSCRIBE john@abc.com
SUBSCRIBE john@abc.com Some_Group
SUBSCRIBE john@abc.com Some_Group,Another_Group

Return to Index   


 
One-Click Unsubscribe Links

A common requirement is an unsubscribe link that can be added to a message allowing a message recipient to unsubscribe themselves simply by clicking the link.

This can be easily achieved by creating a web script that generates a message with the subject:

UNSUBSCRIBE SOME@ADDRESS.COM
(where SOME@ADDRESS.COM is the address that was passed as a parameter to the script).

And sends it to your mailing list address.

A simple enhancements delays the sending of a message until a "Confirm" button is clicked.

You can then use the link in your message using MLK's personalization fields, which will be automatically replaced by the relevant e-mail address:

<a href="http://www.mysite.com/cgi-bin/unsub.asp?email=%EMAIL%>Click here to Unsubscribe</a>

Return to Index   


 
Problems?

If a web form is not processed (i.e. MLK seems to ignore it) then review the three most common reasons:

1. The subject does not match those specified under View>Options, Web Forms

2. The message body does not contain any web forms fields

Web form fields need to be listed one-per-line in the body of the message (not as an attachment), e.g.

Email: john@somewhere.com
Name: John Smith
Action: Subscribe

3. An email address was not found

There needs to be a field that defines the message sender, by default MLK will check for:

Email:

or

E-mail:

If the message sender is the sender address then you can create a hidden field that tells MLK to use the sender address, e.g. have a field formatted thus:

Email: %USE_MESSAGE_SENDER%

This is the most common problem, often fields will be slightly differently formatted, e.g.

Email=john@somewhere.com

When the email field is defined under View>Options, Web Forms, Web Form fields as being:

Email: (i.e. with a colon not an equals sign).
 

If you need any assistance with web forms, please contact us.

Return to Index   


 

Return to the MailList King FAQ