Welcome Guest ( Log In | Register )

Discover the best free computer help!
Learn more about Geeks to Go by taking the tour. Spyware, virus, trojan, fake security or privacy alerts? Read the malware cleaning guide.
      
 
Reply to this topicStart new topic
Emailing HTML Newsletter in ASP, Need Help debugging
Immortalarena
post Jun 11 2008, 09:15 AM
Post #1


Member
***
Posts: 146
OS: Windows XP, Vista Business, Premium and Ultimate



I set up a site that can send out emails of a newsletter, I wanted these letters to be in an HTML format. So here is the code I found to do that:

CODE
<!--
    METADATA
    TYPE="typelib"
    UUID="CD000000-8B95-11D1-82DB-00C04FB1625D"  
    NAME="CDO for Windows 2000 Library"
-->
<%Response.Buffer=TRUE%>
<%
'Dimension variables


dim msgstring


    Set cdoConfig = CreateObject("CDO.Configuration")  
    Dim News_ID
    News_ID = Request.Form("newsID")
    With cdoConfig.Fields  
        .Item(cdoSendUsingMethod) = cdoSendUsingPort  
        .Item(cdoSMTPServer) = "mail.smtpserver.com"
        .Item(cdoSMTPAuthenticate) = 1  
        .Item(cdoSendUsername) = "Sender@site.comt"  
        .Item(cdoSendPassword) = "Password"  
        .Update  
    End With

    MHTMLBody = "http://troop101.net/base/newsletter/newsletter.asp?newsID=" & News_ID
    msgstring = "HTML View has been disabled on your machine, please go to: " & _
    "http://troop101.net/base/newsletter/newsletter.asp?newsID=" & News_ID & " To view this newsletter."


    Set cdoMessage = CreateObject("CDO.Message")  

    With cdoMessage
        Set .Configuration = cdoConfig
        .CreateMHTMLBody MHTMLBody
        .From = "Sender@site.com"
        .To = "Receipient@101.net"
        .Subject = "Troop 101 Alumni Newsletter"
        .TextBody = msgstring
        .Send
        End With

Set cdoMessage = Nothing  
Set cdoConfig = Nothing
if err = 0 then
    Response.write("Messages Sent!")
    end if
%>



This code has worked perfectly for me until just recently when I sent it out to others. They received white text on white background, and could not read the email. The email should have had a blue background on it with the white text.

I thought by declaring MHTMLBody I was getting the page as it appears online, and for me it worked. Thinking some might have web elements blocked I thought I would send a msgstring to them with the site link. This link did not appear on any of the emails, and some received the white text on white background.

I guess my question is, is there anything wrong with the code I am sending, or is there a way to make that better? Or do you think it would be best to just send everyone a link to the newsletter instead of trying to get the problem fixed. Thanks for all the help.

This post has been edited by Immortalarena: Jun 11 2008, 09:16 AM
Go to the top of the page
 
+Quote Post
Major Payne
post Jun 11 2008, 04:25 PM
Post #2


Trusted Techie
Group Icon
Posts: 4,451
From: FEMA took "Tin Can" away!
OS: Win XP/Vista Home Premium. Backup PC: Commodore 64 with 300 baud modem!



Have no idea or suggestions for this, but if this is the online string for the newsletter:
CODE
http://troop101.net/base/newsletter/newsletter.asp?newsID=&%20News_ID


then I do get a dark blue page with the logo along with this message:

QUOTE
Microsoft OLE DB Provider for ODBC Drivers error '80040e14'

[Microsoft][ODBC Microsoft Access Driver] Syntax error (missing operator) in query expression 'newsletter.newsID ='.

/base/newsletter/newsletter.asp, line 24


Maybe you can figure it out from there or let me know if that's suppose to be the link to the online newsletter.

Ron

This post has been edited by Major Payne: Jun 11 2008, 04:27 PM
Go to the top of the page
 
+Quote Post
Immortalarena
post Jun 11 2008, 07:39 PM
Post #3


Member
***
Posts: 146
OS: Windows XP, Vista Business, Premium and Ultimate



The newsID is a variable in the page, an actual newsletter is as follows:

http://troop101.net/base/newsletter/newsletter.asp?newsID=9


And as I said, some people get it fine, the others just get white on white.
Go to the top of the page
 
+Quote Post
Major Payne
post Jun 11 2008, 08:06 PM
Post #4


Trusted Techie
Group Icon
Posts: 4,451
From: FEMA took "Tin Can" away!
OS: Win XP/Vista Home Premium. Backup PC: Commodore 64 with 300 baud modem!



Might ask those that don't get it or get it with white on white whether they have their Options set to not load images. This may just produce the white text on a default white background.

Ron
Go to the top of the page
 
+Quote Post
Immortalarena
post Jun 11 2008, 11:29 PM
Post #5


Member
***
Posts: 146
OS: Windows XP, Vista Business, Premium and Ultimate



Thanks,

Since, I can't control others email pref's, is there a way for the message to determine and post just a link if they have images set not to load?

Thanks again.
Go to the top of the page
 
+Quote Post
Major Payne
post Jun 12 2008, 02:28 AM
Post #6


Trusted Techie
Group Icon
Posts: 4,451
From: FEMA took "Tin Can" away!
OS: Win XP/Vista Home Premium. Backup PC: Commodore 64 with 300 baud modem!



It possibly could be done, but exactly how is beyond what I normally do. Will see if I can get someone to take another look at your post.

Ron
Go to the top of the page
 
+Quote Post
Immortalarena
post Jun 12 2008, 10:02 AM
Post #7


Member
***
Posts: 146
OS: Windows XP, Vista Business, Premium and Ultimate



Thanks! thumbsup.gif
Go to the top of the page
 
+Quote Post
Major Payne
post Jun 12 2008, 06:36 PM
Post #8


Trusted Techie
Group Icon
Posts: 4,451
From: FEMA took "Tin Can" away!
OS: Win XP/Vista Home Premium. Backup PC: Commodore 64 with 300 baud modem!



Post help request for your problem in the Tech Assist section. Good luck. Sorry I couldn't help further.

Ron
Go to the top of the page
 
+Quote Post

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 

Collapse

> Similar Topics

    Topic Title Replies / Views Topic Information
No New Posts   2 / 308 23rd January 2006 - 08:03 PM
Matt T started - last by Matt T
No New Posts   0 / 337 28th April 2006 - 07:41 AM
Allsortgroup started - last by Allsortgroup
No New Posts   0 / 151 23rd July 2006 - 08:55 PM
classyrosel started - last by classyrosel
No New Posts 1 / 309 28th November 2006 - 07:28 PM
JAW1971 started - last by JAW1971

RSS Time is now: 22nd November 2008 - 12:59 AM
Advertisements do not imply our endorsement of that product or service. The forum is run by volunteers who donate their time and expertise. We make every attempt to ensure that the help and advice posted is accurate and will not cause harm to your computer. However, we do not guarantee that they are accurate and they are to be used at your own risk.