473,398 Members | 2,404 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,398 software developers and data experts.

Unsubscribe link in EMAIL

Hi, I have a database of more than 1000 users. I am sending an email to 50 users at a time using CDO. What i do is get all the email addresses first & then split them into a batch of 50 email addresses & send email batch by batch. That means I send out 20 emails ( with 50 users in each mail). This works PERFECT.
How do I put a Unsubscribe link in my email. I am confused as how to put EMAILADDRESS of each user in my code for unsubscribe??

Expand|Select|Wrap|Line Numbers
  1. IF NOT Upload.Form("toaddr") = "All" Then
  2. rs.open "Select [PrimaryEmail] from [Tbl_Contacts-old] where [OrgCatID] = "&Upload.Form("toaddr")&"", db,3,3
  3. Else
  4. rs.open "Select [PrimaryEmail] from [Tbl_Contacts-old]", db,3,3
  5. End IF
  6.  
  7. toaddr = ""
  8.  
  9. Counter = 0
  10. While not rs.eof
  11. Counter = Counter + 1
  12. If Counter = 50 or Counter = 100 or Counter = 150 or Counter = 200 Then 
  13. toaddr = toaddr & rs("PrimaryEmail") & ";~"
  14. Else
  15. toaddr = toaddr & rs("PrimaryEmail") & "; "
  16. End If
  17. rs.movenext
  18. wend
  19. rs.close
  20. 'response.Write(toaddr)
  21.  'on error resume next
  22. PrimaryEmailAddr=split(toaddr,"~")
  23. maxcounter=ubound(PrimaryEmailAddr)
  24. FOR counter=0 TO maxcounter
  25.    IndEmailAddr=PrimaryEmailAddr(counter)
  26.    response.Write(IndEmailAddr)
  27.    response.Write("<Br>")
  28.  
  29.  Dim oMail, iConf, Flds
  30. Set oMail = Server.CreateObject("CDO.Message")
  31. 'oMail.To   = ""& Upload.Form("toaddr") &""
  32. oMail.Bcc = ""&IndEmailAddr&""
  33. 'oMail.Cc = ""
  34. 'oMail.From   = ""&Upload.Form("fromaddr")&""
  35. oMail.From   = info@mysite.com
  36. oMail.Subject   = ""& Upload.Form("subject") &""
  37. 'oMail.TextBody= ""
  38.  
  39.  
  40.    EmailStr=split(IndEmailAddr,";")
  41.  maxcounter1=ubound(EmailStr)
  42.  FOR counter1=0 TO maxcounter1
  43.      curremail1=EmailStr(counter1)
  44.  
  45.  NEXT 
  46.  
  47. oMail.HTMLBody =  ""&Upload.Form("message")&"" & "<br><p><p><b> To Unsubscribe from the mailing list please<a href=""http://mysite.com/process.asp?email=" & curremail1 & "&cancel=yes""> CLICK HERE</a>.</B>" &_
  48.                 "<br /><br> Best Regards,<br>Admin Team."
  49.  
  50. oMail.Send
  51. Set oMail = Nothing
  52.  
  53. NEXT
  54.  
  55.  
Feb 4 '09 #1
3 5452
By unsubscribe I mean providing a link in the email I sent. & once the user clicks on the link his email is automatically removed from the DB. the problem is how do I write user email address in the link:?? Since in my variable "IndEmailAddr" I have 50 email addresses, I know how to split them but how do i write them individually in each mail, which is sent out?

Expand|Select|Wrap|Line Numbers
  1. oMail.HTMLBody =  " To Unsubscribe from the mailing list please<a href=""http://mysite.com/process.asp?email=" & curremail1 & "&cancel=yes""> CLICK HERE</a>.</B>" &_              
Feb 4 '09 #2
jhardman
3,406 Expert 2GB
You could change the link to say "To unsubscribe, send your email address as the subject line to 'unsubscribe@mySite.com'" or "Click here to unsubscribe" and send them to a site where they enter their email address. I know, it's less elegant than an individualized response, but I see that type of solution fairly often.

Jared
Feb 4 '09 #3
Thxs Jared, yeh this I can do, but was trying to find a way where the user just click on UNSUBSCRIBE link & gets deleted automatically.
Feb 4 '09 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: Faust, Chris | last post by:
-----Original Message----- From: python-list-request@python.org Sent: Tuesday, July 08, 2003 9:46 AM To: python-list@python.org Subject: Python-list digest, Vol 1 #16415 - 14 msgs Send...
4
by: zsh-users-help | last post by:
Hi! This is the ezmlm program. I'm managing the zsh-users@sunsite.dk mailing list. To confirm that you would like python-list@python.org removed from the zsh-users mailing list, please send...
7
by: Angelos | last post by:
Hello... I wrote a simple subscribe script that when a user completes the subscription form he gets added in the database and then he receives an e-mail where he/she clicks on the follow link : ...
0
by: Nitish Korla | last post by:
unsubscribe ---------------------------(end of broadcast)--------------------------- TIP 1: subscribe and unsubscribe commands go to majordomo@postgresql.org
7
by: Alex | last post by:
Hi, I just installed pg 7.4.1 on a new system P4, 3.2Gh HT, 1GB Mem, RH9 and discovered that some of the processes have become extremely slow. Mainly I am talking about a SELECT COUNT(*) or...
2
by: Joe | last post by:
Hi, I have a newsletter subscribe page. A user enters email address and clicks Subscribe button. That email address is added to database. Say this is a career newsletter. Is it possible to...
12
by: Edmund Dengler | last post by:
Hi folks! A query I am running does not seem to use indexes that are available (running version 7.4.2). I have the following table: => \d replicated Table "public.replicated" Column | ...
1
by: Lampa Dario | last post by:
I'd like to create a little script to allow users to remove from mailing list. I use the folowing code $remove_msg='Lei riceve questo messaggio poiché si è iscritto alla newsletter. Potrà...
2
by: Cox | last post by:
Hello: My address jsmith435@cox.net is subscribed to at least the PHP General mailing list. I have for days now been trying to unsubscribe from all PHP mail lists. I have followed the...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.