Mailing List Subscription Script

Discussions on webmail and the Professional version.
Post Reply
BrandywineITS
Posts: 19
Joined: Sat Jul 02, 2005 12:32 am

Mailing List Subscription Script

Post by BrandywineITS » Sat Jul 02, 2005 12:33 am

Does anyone have or know of a mailing list script that will subscribe to a list. I've been going at if for days and can't get one to work. Any suggestions would be helpful. Thanks in advance.

rebycman
Posts: 87
Joined: Thu Jan 23, 2003 9:06 pm

Post by rebycman » Mon Jul 04, 2005 9:30 am

Sure thing, this script is a sample that should get ya going. The sections below in bold are fields you need to fill in to make it work with your form. You will also need a page called "you-are-now-subscribed.html" which this script will display when it works and subscribes an email addy to your list. There is no error checking built in, this is just a basic example of a script that will get ya going without too much trouble. If you want more features like error and field checking you can build that in later after you get the basics working.

<%
sendTo = "List Email Address Here"
From = request.form("HTML Form Name Here Sample-1")
Dim objNewMail
Set objNewMail = Server.CreateObject("MEMail.Message")
objNewMail.Server = "127.0.0.1"
objNewMail.MailTo= sendTo
objNewMail.MailFrom= From
objNewMail.Subject = "Subscribe"
objNewMail.MessageBody = "Subscribe" & vbcrlf&_
"Email: " & ESmail & vbcrlf&_
objNewMail.SendMessage
Response.redirect("http://yoursite.com/you-are-now-subscribed.html")

%>

Regards,

-Reby
Last edited by rebycman on Mon Jul 04, 2005 9:40 am, edited 1 time in total.

rebycman
Posts: 87
Joined: Thu Jan 23, 2003 9:06 pm

Post by rebycman » Mon Jul 04, 2005 9:39 am

As an afterthought I figured I'd add an html form sample for you as well. This is the bit of code to slap into your webpage to give the user a field they can type in their email address so the above script can process it.

<form name="Sample-1" action="/scripts/scriptname.asp" method="post">
<p align="left">To add your e-mail address to our
newsletter please enter your e-mail<br>
address and press the submit button.<br>
<input type="text" name="Sample-1" size="20">
<input type="submit" name="Submit" value="Submit">
<input type="reset" name="Submit2" value="Reset">
</p>
</form>

/scripts/scriptname.asp -- Location & file name of the Email Script above
Sample-1 -- Form name value (email address to pass on to script)

Regards,

-Reby

BrandywineITS
Posts: 19
Joined: Sat Jul 02, 2005 12:32 am

Post by BrandywineITS » Tue Aug 02, 2005 8:29 pm

Many, Many Thanks! I have been quite busy and that fire was quenched, as I began to work on it again this week I remembered putting a post here. You just made the rest of my day!

Post Reply