Signup · Login
Stardeveloper.com  
Home · Tutorials · Forums · ASP.NET Newsletter Application · Web Hosting Plans · Faisal Khan's Blog · Contact
Forums : ASP : ASP 3.0 : Sending html News Letter Signup · Login
Author Thread
Sending html News Letter
Posted in tutorial: Create your own Newsletter in ASP 3.0
·  lyanez
User
Joined: 10 Dec 2002
Total Posts: 2

Sending html News Letter

Posted: 10 Dec 2002
Hi, I'm a newbie on this matters, but i used your script and worked great at the first try.

Now i have a question, is there a way of comberting this text-only news letter into a html news letter?

I saw some mail.BodyFormat thing somewere... is this related?

Thank's
·  Faisal Khan
AdminAdminAdminAdmin
Joined: 24 Sep 2002
Total Posts: 595
Re: Sending html News Letter
Posted: 12 Dec 2002
By default if you specify no BodyFormat property, the email will be sent in text/plain format with no HTML formatting.

To use HTML instead of plain text, add following line above the "mail.Body" property:


mail.BodyFormat = CdoBodyFormatHTML

Now you should be able to send HTML formatted emails. :)

Faisal Khan.
Stardeveloper.com
Read Blog | Follow on Facebook, Twitter
·  lyanez
User
Joined: 10 Dec 2002
Total Posts: 2
Re: Sending html News Letter
Posted: 13 Dec 2002
Thank's, it worked nicely, but I sitill had two problems, if I read the email sent through a web based mail i would only see the code so i used a line I saw on other script:

mail.MailFormat = 0

Right after mail.BodyFormat and then I could see it right.

The problem that remains is that the link on the message variable displays as text not as a link, i tried to add the link fotmat to it, but the email= variable would not display the mail addres on the link.

So I made a form similar to the mail.html but it would submit you to the del.asp file in wich i changed the line:

email = Request.QueryString("email")

for

email = Request.Form("email")

This works, but I'd rather have the link you supplied in the first plase, because it is so much simpler for the user to follow.
·  eniojur
User
Joined: 2 Dec 2002
Total Posts: 4
good question
Posted: 14 Dec 2002
I was about to ask this question. Great.

Nobody receive the message. in this stream have I to configure some? Set mail = Server.CreateObject("CDONTS.NewMail")
·  Faisal Khan
AdminAdminAdminAdmin
Joined: 24 Sep 2002
Total Posts: 595
Re: Sending html News Letter
Posted: 14 Dec 2002
One rather difficult option would be to use "To Unsubscribe, Reply to this email with 'Remove' in the subject line".

To do that, you'll have to create a separate email account for that list e.g. list1@yoursite.com. Then set the mail.From to list1@yoursite.com. Every user which wants to unsubscribe will send email to list1@yoursite.com with 'Remove' in the subject line.

Now you should have an ASP script with a POP3 COM component. That ASP script e.g. unsubscribeUsers.asp, will when called by you, connect to your POP3 server, receive all the emails for list1@yoursite.com. Then iterate through that list and separate the emails with 'Remove' in the subject line. Then run an SQL command to delete all users from the list whose 'From' address in the 'Remove' email is found in the 'Newsletter' database.

I hope you'd have got the idea. I know it is difficult to implement but then hey, it is an option. :)

Faisal Khan.
Stardeveloper.com
Read Blog | Follow on Facebook, Twitter
·  khaen
User
Joined: 17 Jan 2003
Total Posts: 1
mail Charset
Posted: 17 Jan 2003
Thank you for this tutorial, it is easy and nice! I have an offtopic question.
I tried this with Japanese and everything works,
as it should, but sended mail comes in Western encoding,
so the user should set the browser encoding to Japanese in order to view newsletter.
Is there a way to set a default encoding for sended mail in CDONTS?
TIA, Elena

Want to leave a comment? Login or Register for free!

Users Who Have Visited This Thread In Last 24 Hours
3 Visitors

Login to post a comment or start a new thread
UserName Or Email Address:       Password:       Auto-Login:    
· Create New User Account
· Send Forgotten Password by Email
 
© 1999 - 2010 Stardeveloper.com, All Rights Reserved.