Ask a Question related to ASP Components, Design and Development.

  1. #1

    Default CDO Message Problem

    I'm having trouble with an html formatted email that is being delivered

    to a client. Every 80 characters there is a forced space being added
    to the emails (by the server? by cdo Message?) and it's causing the
    html tags to be broken. The unusual thing is that I cannot replicate
    the error locally in Outlook, or @ gmail or @ hotmail. Only the client

    is having the issue (Using Outlook Express).

    Is this an issue that most mail clients have resolved, or is this
    something that I will have to take care of from my side?


    Thanks!

    9ntw9 Guest

  2. Similar Questions and Discussions

    1. Javascript alert message problem
      Hello. I'm developing and testing a web application using VS.NET 2003, VB, .NET Framework 1.1.4322, ASP.NET 1.1.4322 and IIS5.1 on a WIN XP Pro,...
    2. Message problem on every page using shockwave...
      Very recently, for some unknown reason, whenever I try to use a webpage that has shockwave features on it i get an In ternet explorer window with...
    3. CFMAIL problem - every nth message disappears
      ISP is running CF 4, 5, 1, SP2 Discovered a problem recently whereby every 12th message sent from a list never arrives, have been using the same...
    4. problem with a string error message
      Hi, I have a problem im tryin to convert the orginal sql stored procedure into a coldfusion file. Any way ive got the point of the tring error...
    5. Delete error message problem
      Hi there, i have a delete button on my form with the following code: docmd.runcommand.acCmdDeleteRecord When i run the code click delete, i...
  3. #2

    Default Re: CDO Message Problem


    "9ntw9" <nathaniel.williams@gmail.com> wrote in message
    news:1167834352.020953.260230@k21g2000cwa.googlegr oups.com...
    > I'm having trouble with an html formatted email that is being delivered
    >
    > to a client. Every 80 characters there is a forced space being added
    > to the emails (by the server? by cdo Message?) and it's causing the
    > html tags to be broken. The unusual thing is that I cannot replicate
    > the error locally in Outlook, or @ gmail or @ hotmail. Only the client
    >
    > is having the issue (Using Outlook Express).
    >
    > Is this an issue that most mail clients have resolved, or is this
    > something that I will have to take care of from my side?
    >
    Sounds like the body is not being formatted as quoted-printable. Can you
    show some code you are using to create the email?
    Can you change the configuration object to use a temporary folder as a
    pickup folder instead of port 25? you can then examine the exact EML file
    being created.

    >
    > Thanks!
    >

    Anthony Jones Guest

  4. #3

    Default Re: CDO Message Problem

    Thanks for your time,

    Here is the code being used to send the mail:

    Set objMail = Server.CreateObject("CDO.Message")
    objMail.MIMEFormatted=true
    objMail.From = sFrom
    objMail.To = sTo
    objMail.Subject= sSubject
    objMail.HTMLBody = sTextBody
    objMail.Send

    I set the MIMEFormatted = True after reading an article that suggested
    it would fix the problem, but no luck. (There was no apparent change)

    sTextBody (the contents being afftected by the issue) is derived from a
    chunk of code that pulls various items out of a db and builds them into
    an html table for viewing (6 cols wide, N cols long) ... the html being
    written is standard, and there's nothing too fancy going on. The
    contents of sTextBody are not being prepped for email (do they need to
    be, if so, in what fashion?), the html inside sTextBody are written as
    though for a standard webpage (although without opening html tags,
    basically written to be dropped into the body section of a website).

    Thanks again,

    Nathaniel


    Anthony Jones wrote:
    > "9ntw9" <nathaniel.williams@gmail.com> wrote in message
    > news:1167834352.020953.260230@k21g2000cwa.googlegr oups.com...
    > > I'm having trouble with an html formatted email that is being delivered
    > >
    > > to a client. Every 80 characters there is a forced space being added
    > > to the emails (by the server? by cdo Message?) and it's causing the
    > > html tags to be broken. The unusual thing is that I cannot replicate
    > > the error locally in Outlook, or @ gmail or @ hotmail. Only the client
    > >
    > > is having the issue (Using Outlook Express).
    > >
    > > Is this an issue that most mail clients have resolved, or is this
    > > something that I will have to take care of from my side?
    > >
    >
    > Sounds like the body is not being formatted as quoted-printable. Can you
    > show some code you are using to create the email?
    > Can you change the configuration object to use a temporary folder as a
    > pickup folder instead of port 25? you can then examine the exact EML file
    > being created.
    >
    >
    > >
    > > Thanks!
    > >
    9ntw9 Guest

  5. #4

    Default Re: CDO Message Problem

    Just to add, I recently added the 1st function on this page to my mail:

    [url]http://www.motobit.com/tips/detpg_quoted-printable-encode/[/url]

    so now the line reads : objMail.HTMLBody =
    QuotedPrintableEncode(sTextBody, "") instead of objMail.HTMLBody =
    sTextBody

    I am not sure if this is what you were referring to originally, but
    after a quick look at the results I've found that it does a pretty good
    job of destroying the formatting of the html (squishes it), and it
    renders images a small black squares.


    9ntw9 wrote:
    > Thanks for your time,
    >
    > Here is the code being used to send the mail:
    >
    > Set objMail = Server.CreateObject("CDO.Message")
    > objMail.MIMEFormatted=true
    > objMail.From = sFrom
    > objMail.To = sTo
    > objMail.Subject= sSubject
    > objMail.HTMLBody = sTextBody
    > objMail.Send
    >
    > I set the MIMEFormatted = True after reading an article that suggested
    > it would fix the problem, but no luck. (There was no apparent change)
    >
    > sTextBody (the contents being afftected by the issue) is derived from a
    > chunk of code that pulls various items out of a db and builds them into
    > an html table for viewing (6 cols wide, N cols long) ... the html being
    > written is standard, and there's nothing too fancy going on. The
    > contents of sTextBody are not being prepped for email (do they need to
    > be, if so, in what fashion?), the html inside sTextBody are written as
    > though for a standard webpage (although without opening html tags,
    > basically written to be dropped into the body section of a website).
    >
    > Thanks again,
    >
    > Nathaniel
    >
    >
    > Anthony Jones wrote:
    > > "9ntw9" <nathaniel.williams@gmail.com> wrote in message
    > > news:1167834352.020953.260230@k21g2000cwa.googlegr oups.com...
    > > > I'm having trouble with an html formatted email that is being delivered
    > > >
    > > > to a client. Every 80 characters there is a forced space being added
    > > > to the emails (by the server? by cdo Message?) and it's causing the
    > > > html tags to be broken. The unusual thing is that I cannot replicate
    > > > the error locally in Outlook, or @ gmail or @ hotmail. Only the client
    > > >
    > > > is having the issue (Using Outlook Express).
    > > >
    > > > Is this an issue that most mail clients have resolved, or is this
    > > > something that I will have to take care of from my side?
    > > >
    > >
    > > Sounds like the body is not being formatted as quoted-printable. Can you
    > > show some code you are using to create the email?
    > > Can you change the configuration object to use a temporary folder as a
    > > pickup folder instead of port 25? you can then examine the exact EML file
    > > being created.
    > >
    > >
    > > >
    > > > Thanks!
    > > >
    9ntw9 Guest

  6. #5

    Default Re: CDO Message Problem

    I was searching the web for quite some time trying to solve pretty same
    problem.
    My script is the same as yours Nathaniel. Since last month or so I
    started to get wrapped html mails, before that everything was just
    fine. May it be some ms update to the cdosys component?

    In my case I get html mails where some characters disappear or spaces
    are added, so it breaks the html structure.

    Have not found solution yet. Will post here if found.

    Alex

    9ntw9 raše:
    > Just to add, I recently added the 1st function on this page to my mail:
    >
    > [url]http://www.motobit.com/tips/detpg_quoted-printable-encode/[/url]
    >
    > so now the line reads : objMail.HTMLBody =
    > QuotedPrintableEncode(sTextBody, "") instead of objMail.HTMLBody =
    > sTextBody
    >
    > I am not sure if this is what you were referring to originally, but
    > after a quick look at the results I've found that it does a pretty good
    > job of destroying the formatting of the html (squishes it), and it
    > renders images a small black squares.
    >
    >
    > 9ntw9 wrote:
    > > Thanks for your time,
    > >
    > > Here is the code being used to send the mail:
    > >
    > > Set objMail = Server.CreateObject("CDO.Message")
    > > objMail.MIMEFormatted=true
    > > objMail.From = sFrom
    > > objMail.To = sTo
    > > objMail.Subject= sSubject
    > > objMail.HTMLBody = sTextBody
    > > objMail.Send
    > >
    > > I set the MIMEFormatted = True after reading an article that suggested
    > > it would fix the problem, but no luck. (There was no apparent change)
    > >
    > > sTextBody (the contents being afftected by the issue) is derived from a
    > > chunk of code that pulls various items out of a db and builds them into
    > > an html table for viewing (6 cols wide, N cols long) ... the html being
    > > written is standard, and there's nothing too fancy going on. The
    > > contents of sTextBody are not being prepped for email (do they need to
    > > be, if so, in what fashion?), the html inside sTextBody are written as
    > > though for a standard webpage (although without opening html tags,
    > > basically written to be dropped into the body section of a website).
    > >
    > > Thanks again,
    > >
    > > Nathaniel
    > >
    > >
    > > Anthony Jones wrote:
    > > > "9ntw9" <nathaniel.williams@gmail.com> wrote in message
    > > > news:1167834352.020953.260230@k21g2000cwa.googlegr oups.com...
    > > > > I'm having trouble with an html formatted email that is being delivered
    > > > >
    > > > > to a client. Every 80 characters there is a forced space being added
    > > > > to the emails (by the server? by cdo Message?) and it's causing the
    > > > > html tags to be broken. The unusual thing is that I cannot replicate
    > > > > the error locally in Outlook, or @ gmail or @ hotmail. Only the client
    > > > >
    > > > > is having the issue (Using Outlook Express).
    > > > >
    > > > > Is this an issue that most mail clients have resolved, or is this
    > > > > something that I will have to take care of from my side?
    > > > >
    > > >
    > > > Sounds like the body is not being formatted as quoted-printable. Canyou
    > > > show some code you are using to create the email?
    > > > Can you change the configuration object to use a temporary folder as a
    > > > pickup folder instead of port 25? you can then examine the exact EML file
    > > > being created.
    > > >
    > > >
    > > > >
    > > > > Thanks!
    > > > >
    elesus@gmail.com Guest

  7. #6

    Default Re: CDO Message Problem

    I've tried another approach now:

    function tester (sBody)
    Dim iMsg
    Dim iBp1
    Dim iBp3
    Dim Stm

    Set iMsg = CreateObject("CDO.Message")

    With iMsg
    .From = sFrom
    .To = sTo
    .Subject = sSubject
    End With

    Set iBp1 = iMsg.BodyPart
    iBp1.ContentMediaType = "multipart/mixed"

    Set iBp3 = iBp1.AddBodyPart
    With iBp3
    .ContentMediaType = "text/html"
    .ContentTransferEncoding = "quoted-printable"
    Set Stm = .GetDecodedContentStream
    Stm.WriteText sBody
    Stm.Flush
    End With

    Stm.Close
    Set Stm = Nothing
    iMsg.Send
    end function





    ---------
    i then wrote iMsg.GetStream.ReadText to the screen and got this:

    thread-index: AccwS7JFFUXwh40fTiWWguVEYVtupw== Thread-Topic: A html and
    text message with attachment. From: To: Subject: A html and text
    message with attachment. MIME-Version: 1.0 Content-Type: text/html
    Content-Transfer-Encoding: 7bit Content-Class:
    urn:content-classes:message Importance: normal Priority: normal
    X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.2757


    followed by an output of the actual message.

    Is there anything in this header info that stands out as being the
    problem to anyone?

    I've implemented this new mail function and I'm waiting to here back
    from my client (as I've enver been able to reproduce the error myself).

    Thanks again everyone!






    [email]elesus@gmail.com[/email] wrote:
    > I was searching the web for quite some time trying to solve pretty same
    > problem.
    > My script is the same as yours Nathaniel. Since last month or so I
    > started to get wrapped html mails, before that everything was just
    > fine. May it be some ms update to the cdosys component?
    >
    > In my case I get html mails where some characters disappear or spaces
    > are added, so it breaks the html structure.
    >
    > Have not found solution yet. Will post here if found.
    >
    > Alex
    >
    > 9ntw9 raše:
    > > Just to add, I recently added the 1st function on this page to my mail:
    > >
    > > [url]http://www.motobit.com/tips/detpg_quoted-printable-encode/[/url]
    > >
    > > so now the line reads : objMail.HTMLBody =
    > > QuotedPrintableEncode(sTextBody, "") instead of objMail.HTMLBody =
    > > sTextBody
    > >
    > > I am not sure if this is what you were referring to originally, but
    > > after a quick look at the results I've found that it does a pretty good
    > > job of destroying the formatting of the html (squishes it), and it
    > > renders images a small black squares.
    > >
    > >
    > > 9ntw9 wrote:
    > > > Thanks for your time,
    > > >
    > > > Here is the code being used to send the mail:
    > > >
    > > > Set objMail = Server.CreateObject("CDO.Message")
    > > > objMail.MIMEFormatted=true
    > > > objMail.From = sFrom
    > > > objMail.To = sTo
    > > > objMail.Subject= sSubject
    > > > objMail.HTMLBody = sTextBody
    > > > objMail.Send
    > > >
    > > > I set the MIMEFormatted = True after reading an article that suggested
    > > > it would fix the problem, but no luck. (There was no apparent change)
    > > >
    > > > sTextBody (the contents being afftected by the issue) is derived froma
    > > > chunk of code that pulls various items out of a db and builds them into
    > > > an html table for viewing (6 cols wide, N cols long) ... the html being
    > > > written is standard, and there's nothing too fancy going on. The
    > > > contents of sTextBody are not being prepped for email (do they need to
    > > > be, if so, in what fashion?), the html inside sTextBody are written as
    > > > though for a standard webpage (although without opening html tags,
    > > > basically written to be dropped into the body section of a website).
    > > >
    > > > Thanks again,
    > > >
    > > > Nathaniel
    > > >
    > > >
    > > > Anthony Jones wrote:
    > > > > "9ntw9" <nathaniel.williams@gmail.com> wrote in message
    > > > > news:1167834352.020953.260230@k21g2000cwa.googlegr oups.com...
    > > > > > I'm having trouble with an html formatted email that is being delivered
    > > > > >
    > > > > > to a client. Every 80 characters there is a forced space being added
    > > > > > to the emails (by the server? by cdo Message?) and it's causing the
    > > > > > html tags to be broken. The unusual thing is that I cannot replicate
    > > > > > the error locally in Outlook, or @ gmail or @ hotmail. Only the client
    > > > > >
    > > > > > is having the issue (Using Outlook Express).
    > > > > >
    > > > > > Is this an issue that most mail clients have resolved, or is this
    > > > > > something that I will have to take care of from my side?
    > > > > >
    > > > >
    > > > > Sounds like the body is not being formatted as quoted-printable. Can you
    > > > > show some code you are using to create the email?
    > > > > Can you change the configuration object to use a temporary folder as a
    > > > > pickup folder instead of port 25? you can then examine the exact EML file
    > > > > being created.
    > > > >
    > > > >
    > > > > >
    > > > > > Thanks!
    > > > > >
    9ntw9 Guest

  8. #7

    Default Re: CDO Message Problem

    Forgot to mention in my previous post that the function i posted is
    based off of the code example found on the following page:

    [url]http://msdn2.microsoft.com/en-us/library/aa581351.aspx[/url]


    9ntw9 wrote:
    > I've tried another approach now:
    >
    > function tester (sBody)
    > Dim iMsg
    > Dim iBp1
    > Dim iBp3
    > Dim Stm
    >
    > Set iMsg = CreateObject("CDO.Message")
    >
    > With iMsg
    > .From = sFrom
    > .To = sTo
    > .Subject = sSubject
    > End With
    >
    > Set iBp1 = iMsg.BodyPart
    > iBp1.ContentMediaType = "multipart/mixed"
    >
    > Set iBp3 = iBp1.AddBodyPart
    > With iBp3
    > .ContentMediaType = "text/html"
    > .ContentTransferEncoding = "quoted-printable"
    > Set Stm = .GetDecodedContentStream
    > Stm.WriteText sBody
    > Stm.Flush
    > End With
    >
    > Stm.Close
    > Set Stm = Nothing
    > iMsg.Send
    > end function
    >
    >
    >
    >
    >
    > ---------
    > i then wrote iMsg.GetStream.ReadText to the screen and got this:
    >
    > thread-index: AccwS7JFFUXwh40fTiWWguVEYVtupw== Thread-Topic: A html and
    > text message with attachment. From: To: Subject: A html and text
    > message with attachment. MIME-Version: 1.0 Content-Type: text/html
    > Content-Transfer-Encoding: 7bit Content-Class:
    > urn:content-classes:message Importance: normal Priority: normal
    > X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.2757
    >
    >
    > followed by an output of the actual message.
    >
    > Is there anything in this header info that stands out as being the
    > problem to anyone?
    >
    > I've implemented this new mail function and I'm waiting to here back
    > from my client (as I've enver been able to reproduce the error myself).
    >
    > Thanks again everyone!
    >
    >
    >
    >
    >
    >
    > [email]elesus@gmail.com[/email] wrote:
    > > I was searching the web for quite some time trying to solve pretty same
    > > problem.
    > > My script is the same as yours Nathaniel. Since last month or so I
    > > started to get wrapped html mails, before that everything was just
    > > fine. May it be some ms update to the cdosys component?
    > >
    > > In my case I get html mails where some characters disappear or spaces
    > > are added, so it breaks the html structure.
    > >
    > > Have not found solution yet. Will post here if found.
    > >
    > > Alex
    > >
    > > 9ntw9 raše:
    > > > Just to add, I recently added the 1st function on this page to my mail:
    > > >
    > > > [url]http://www.motobit.com/tips/detpg_quoted-printable-encode/[/url]
    > > >
    > > > so now the line reads : objMail.HTMLBody =
    > > > QuotedPrintableEncode(sTextBody, "") instead of objMail.HTMLBody =
    > > > sTextBody
    > > >
    > > > I am not sure if this is what you were referring to originally, but
    > > > after a quick look at the results I've found that it does a pretty good
    > > > job of destroying the formatting of the html (squishes it), and it
    > > > renders images a small black squares.
    > > >
    > > >
    > > > 9ntw9 wrote:
    > > > > Thanks for your time,
    > > > >
    > > > > Here is the code being used to send the mail:
    > > > >
    > > > > Set objMail = Server.CreateObject("CDO.Message")
    > > > > objMail.MIMEFormatted=true
    > > > > objMail.From = sFrom
    > > > > objMail.To = sTo
    > > > > objMail.Subject= sSubject
    > > > > objMail.HTMLBody = sTextBody
    > > > > objMail.Send
    > > > >
    > > > > I set the MIMEFormatted = True after reading an article that suggested
    > > > > it would fix the problem, but no luck. (There was no apparent change)
    > > > >
    > > > > sTextBody (the contents being afftected by the issue) is derived from a
    > > > > chunk of code that pulls various items out of a db and builds them into
    > > > > an html table for viewing (6 cols wide, N cols long) ... the html being
    > > > > written is standard, and there's nothing too fancy going on. The
    > > > > contents of sTextBody are not being prepped for email (do they needto
    > > > > be, if so, in what fashion?), the html inside sTextBody are writtenas
    > > > > though for a standard webpage (although without opening html tags,
    > > > > basically written to be dropped into the body section of a website).
    > > > >
    > > > > Thanks again,
    > > > >
    > > > > Nathaniel
    > > > >
    > > > >
    > > > > Anthony Jones wrote:
    > > > > > "9ntw9" <nathaniel.williams@gmail.com> wrote in message
    > > > > > news:1167834352.020953.260230@k21g2000cwa.googlegr oups.com...
    > > > > > > I'm having trouble with an html formatted email that is being delivered
    > > > > > >
    > > > > > > to a client. Every 80 characters there is a forced space beingadded
    > > > > > > to the emails (by the server? by cdo Message?) and it's causingthe
    > > > > > > html tags to be broken. The unusual thing is that I cannot replicate
    > > > > > > the error locally in Outlook, or @ gmail or @ hotmail. Only the client
    > > > > > >
    > > > > > > is having the issue (Using Outlook Express).
    > > > > > >
    > > > > > > Is this an issue that most mail clients have resolved, or is this
    > > > > > > something that I will have to take care of from my side?
    > > > > > >
    > > > > >
    > > > > > Sounds like the body is not being formatted as quoted-printable. Can you
    > > > > > show some code you are using to create the email?
    > > > > > Can you change the configuration object to use a temporary folderas a
    > > > > > pickup folder instead of port 25? you can then examine the exact EML file
    > > > > > being created.
    > > > > >
    > > > > >
    > > > > > >
    > > > > > > Thanks!
    > > > > > >
    9ntw9 Guest

  9. #8

    Default Re: CDO Message Problem


    "9ntw9" <nathaniel.williams@gmail.com> wrote in message
    news:1167944823.401987.233270@42g2000cwt.googlegro ups.com...
    > Thanks for your time,
    >
    > Here is the code being used to send the mail:
    >
    > Set objMail = Server.CreateObject("CDO.Message")
    > objMail.MIMEFormatted=true
    > objMail.From = sFrom
    > objMail.To = sTo
    > objMail.Subject= sSubject
    > objMail.HTMLBody = sTextBody
    > objMail.Send
    >
    > I set the MIMEFormatted = True after reading an article that suggested
    > it would fix the problem, but no luck. (There was no apparent change)
    >
    Try this:-

    Create an empty folder E.g. c:\temp\pickup

    Now add this code after creating objMail :-

    Dim oConf: Set oConf = objMail.Configuration
    oConf.Fields("http://schemas.microsoft.com/cdo/configuration/sendusing")= 1
    'Use pickup folder
    oConf.Fields([url]http://schemas.microsoft.com/cdo/configuration/smtpserverpickup[/url]
    directory") = _
    "c:\temp\pickup"
    oConf.Update

    Now when you execute your code you should get an .eml file appear in pickup
    folder. You can open this file in outlook express to see if it is mangled
    before it's ever passed through a SMTP server. You can also open it in
    notepad to see exactly what has been generated.

    The header to the HTML body part should look something like this:-

    ------_=_NextPart_003_01C657E9.493172D2
    Content-Type: text/html;
    charset="us-ascii"
    Content-Transfer-Encoding: quoted-printable




    Anthony Jones Guest

  10. #9

    Default Re: CDO Message Problem

    I used the code to send it to a directory, and checked the files ...

    I had set ContentTransferCoding = "quoted-printable" in iBp3 (an
    additional body part of my base iBp1), but had never set iBp1, so it
    was sending in 7bit.

    Hopefully this has fixed my problem!

    p.s. to anyone attempting to use the code in the previous msg, I had to
    change oConf.Update to oConf.Fields.Update to get it running.

    I'll run some tests (with fingers crossed) and let everyone know if
    this fixed it.

    Thanks!

    Anthony Jones wrote:
    > "9ntw9" <nathaniel.williams@gmail.com> wrote in message
    > news:1167944823.401987.233270@42g2000cwt.googlegro ups.com...
    > > Thanks for your time,
    > >
    > > Here is the code being used to send the mail:
    > >
    > > Set objMail = Server.CreateObject("CDO.Message")
    > > objMail.MIMEFormatted=true
    > > objMail.From = sFrom
    > > objMail.To = sTo
    > > objMail.Subject= sSubject
    > > objMail.HTMLBody = sTextBody
    > > objMail.Send
    > >
    > > I set the MIMEFormatted = True after reading an article that suggested
    > > it would fix the problem, but no luck. (There was no apparent change)
    > >
    >
    > Try this:-
    >
    > Create an empty folder E.g. c:\temp\pickup
    >
    > Now add this code after creating objMail :-
    >
    > Dim oConf: Set oConf = objMail.Configuration
    > oConf.Fields("http://schemas.microsoft.com/cdo/configuration/sendusing")= 1
    > 'Use pickup folder
    > oConf.Fields([url]http://schemas.microsoft.com/cdo/configuration/smtpserverpickup[/url]
    > directory") = _
    > "c:\temp\pickup"
    > oConf.Update
    >
    > Now when you execute your code you should get an .eml file appear in pickup
    > folder. You can open this file in outlook express to see if it is mangled
    > before it's ever passed through a SMTP server. You can also open it in
    > notepad to see exactly what has been generated.
    >
    > The header to the HTML body part should look something like this:-
    >
    > ------_=_NextPart_003_01C657E9.493172D2
    > Content-Type: text/html;
    > charset="us-ascii"
    > Content-Transfer-Encoding: quoted-printable
    9ntw9 Guest

  11. #10

    Default Re: CDO Message Problem

    Addition of the "tester" function alone did not work for me.
    However when I modified the script to attach the file with the same
    html content I send, everything worked fine.

    I added the following code:

    Set fso = CreateObject("Scripting.FileSystemObject")
    Set testfile= fso.CreateTextFile("main.html", True)
    testfile.Write VBody
    testfile.Close
    objMessage.AddAttachment "C:\MyPath\main.html"

    It is at least strange. Fortunately, this work around suits me :)


    9ntw9 raše:
    > I used the code to send it to a directory, and checked the files ...
    >
    > I had set ContentTransferCoding = "quoted-printable" in iBp3 (an
    > additional body part of my base iBp1), but had never set iBp1, so it
    > was sending in 7bit.
    >
    > Hopefully this has fixed my problem!
    >
    > p.s. to anyone attempting to use the code in the previous msg, I had to
    > change oConf.Update to oConf.Fields.Update to get it running.
    >
    > I'll run some tests (with fingers crossed) and let everyone know if
    > this fixed it.
    >
    > Thanks!
    >
    > Anthony Jones wrote:
    > > "9ntw9" <nathaniel.williams@gmail.com> wrote in message
    > > news:1167944823.401987.233270@42g2000cwt.googlegro ups.com...
    > > > Thanks for your time,
    > > >
    > > > Here is the code being used to send the mail:
    > > >
    > > > Set objMail = Server.CreateObject("CDO.Message")
    > > > objMail.MIMEFormatted=true
    > > > objMail.From = sFrom
    > > > objMail.To = sTo
    > > > objMail.Subject= sSubject
    > > > objMail.HTMLBody = sTextBody
    > > > objMail.Send
    > > >
    > > > I set the MIMEFormatted = True after reading an article that suggested
    > > > it would fix the problem, but no luck. (There was no apparent change)
    > > >
    > >
    > > Try this:-
    > >
    > > Create an empty folder E.g. c:\temp\pickup
    > >
    > > Now add this code after creating objMail :-
    > >
    > > Dim oConf: Set oConf = objMail.Configuration
    > > oConf.Fields("http://schemas.microsoft.com/cdo/configuration/sendusing")= 1
    > > 'Use pickup folder
    > > oConf.Fields([url]http://schemas.microsoft.com/cdo/configuration/smtpserverpickup[/url]
    > > directory") = _
    > > "c:\temp\pickup"
    > > oConf.Update
    > >
    > > Now when you execute your code you should get an .eml file appear in pickup
    > > folder. You can open this file in outlook express to see if it is mangled
    > > before it's ever passed through a SMTP server. You can also open it in
    > > notepad to see exactly what has been generated.
    > >
    > > The header to the HTML body part should look something like this:-
    > >
    > > ------_=_NextPart_003_01C657E9.493172D2
    > > Content-Type: text/html;
    > > charset="us-ascii"
    > > Content-Transfer-Encoding: quoted-printable
    elesus@gmail.com Guest

  12. #11

    Default Re: CDO Message Problem

    One more interesting thing.

    When I changed the "sendusing" attribute to "1" (pickup folder) the
    generated eml message was NOT garbled (when opened with Outlook it
    looked correct).

    However changing the "sendusing" attribute to "2" (smtp server) the
    message got corrupted.

    I tried different smtp server to eliminate the server from possible
    causes of the problem but it did not help. So, I assume, the CDOSYS is
    the problem.


    9ntw9 raše:
    > I used the code to send it to a directory, and checked the files ...
    >
    > I had set ContentTransferCoding = "quoted-printable" in iBp3 (an
    > additional body part of my base iBp1), but had never set iBp1, so it
    > was sending in 7bit.
    >
    > Hopefully this has fixed my problem!
    >
    > p.s. to anyone attempting to use the code in the previous msg, I had to
    > change oConf.Update to oConf.Fields.Update to get it running.
    >
    > I'll run some tests (with fingers crossed) and let everyone know if
    > this fixed it.
    >
    > Thanks!
    >
    > Anthony Jones wrote:
    > > "9ntw9" <nathaniel.williams@gmail.com> wrote in message
    > > news:1167944823.401987.233270@42g2000cwt.googlegro ups.com...
    > > > Thanks for your time,
    > > >
    > > > Here is the code being used to send the mail:
    > > >
    > > > Set objMail = Server.CreateObject("CDO.Message")
    > > > objMail.MIMEFormatted=true
    > > > objMail.From = sFrom
    > > > objMail.To = sTo
    > > > objMail.Subject= sSubject
    > > > objMail.HTMLBody = sTextBody
    > > > objMail.Send
    > > >
    > > > I set the MIMEFormatted = True after reading an article that suggested
    > > > it would fix the problem, but no luck. (There was no apparent change)
    > > >
    > >
    > > Try this:-
    > >
    > > Create an empty folder E.g. c:\temp\pickup
    > >
    > > Now add this code after creating objMail :-
    > >
    > > Dim oConf: Set oConf = objMail.Configuration
    > > oConf.Fields("http://schemas.microsoft.com/cdo/configuration/sendusing")= 1
    > > 'Use pickup folder
    > > oConf.Fields([url]http://schemas.microsoft.com/cdo/configuration/smtpserverpickup[/url]
    > > directory") = _
    > > "c:\temp\pickup"
    > > oConf.Update
    > >
    > > Now when you execute your code you should get an .eml file appear in pickup
    > > folder. You can open this file in outlook express to see if it is mangled
    > > before it's ever passed through a SMTP server. You can also open it in
    > > notepad to see exactly what has been generated.
    > >
    > > The header to the HTML body part should look something like this:-
    > >
    > > ------_=_NextPart_003_01C657E9.493172D2
    > > Content-Type: text/html;
    > > charset="us-ascii"
    > > Content-Transfer-Encoding: quoted-printable
    elesus@gmail.com Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139