|
it
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Malformed email with CDO.Message in ASP
Hello,
We have several cases where an email, send with the CDO.Message object in ASP, is received malformed at the receiver's e-mail address. >From the ASP code we send a html email with some tables and other html code in it. When the message is received at the client's email addressthere are some characters or text mallformed, each time at another position in the e-mail. I know for sure that the html code is valid so that's not the problem. The script runs from a Windows 2003 webserver edition with IIS 6.0. Does this problem sounds familiair to anyone? best regards, Jens Show quote
"Jens" <p.meg***@gmail.com> wrote in message It would be useful if you showed your code so that we could see what you arenews:1193211807.825287.305070@v23g2000prn.googlegroups.com... > Hello, > > We have several cases where an email, send with the CDO.Message object > in ASP, is received malformed at the receiver's e-mail address. > > >From the ASP code we send a html email with some tables and other html > code in it. When the message is received at the client's email address > there are some characters or text mallformed, each time at another > position in the e-mail. I know for sure that the html code is valid so > that's not the problem. > > The script runs from a Windows 2003 webserver edition with IIS 6.0. > Does this problem sounds familiair to anyone? > doing. How reproducable is it? If you send the exact same email to several recipients do they each get a corrupted copy and are the corruptions the same? Use a pickup folder configuration where the folder specified is a temporary folder. Open the resulting eml file in outlook express. Is the content corrupt? -- Anthony Jones - MVP ASP/ASP.NET Hello,
We use the code below to send the message. It seems that some receive the message well, while other mail clients have problems with it. Also the error is at another place each time, maybe because the contents of the table are variable and based on the order details. MailContent = "<p>Dear user,<br><br>" &_ "Please find your order confirmation below: " &_ "<table border=0 width=658 cellspacing=0 cellpadding=0><tr><td>Table content</td></tr></table></p>" Set cdoConfig = CreateObject("CDO.Configuration") With cdoConfig.Fields .Item(cdoSendUsingMethod) = cdoSendUsingPort .Item(cdoSMTPServer) = "192.168.0.1" .Item(cdoSMTPServerport) = "25" .Update End With Set cdoMessage = CreateObject("CDO.Message") With cdoMessage Set .Configuration = cdoConfig .From = "i***@email.com" .To = "ï***@email.com" .Subject = "Order confirmation" .HTMLBody = MailContent .Send End With best regards, Jens "Jens" <p.meg***@gmail.com> wrote in message We use the code below to send the message.news:1193228217.736243.163440@k35g2000prh.googlegroups.com... >>>>>>>>>>>>> Hello, It seems that some receive the message well, while other mail clients have problems with it. Also the error is at another place each time, maybe because the contents of the table are variable and based on the order details. MailContent = "<p>Dear user,<br><br>" &_ "Please find your order confirmation below: " &_ "<table border=0 width=658 cellspacing=0 cellpadding=0><tr><td>Table content</td></tr></table></p>" Set cdoConfig = CreateObject("CDO.Configuration") With cdoConfig.Fields ..Item(cdoSendUsingMethod) = cdoSendUsingPort ..Item(cdoSMTPServer) = "192.168.0.1" ..Item(cdoSMTPServerport) = "25" ..Update End With Set cdoMessage = CreateObject("CDO.Message") With cdoMessage Set .Configuration = cdoConfig ..From = "i***@email.com" ..To = "ï***@email.com" ..Subject = "Order confirmation" ..HTMLBody = MailContent ..Send End With <<<<<<<<<<<<< Change cdoconfig to:- With cdoConfig .Fields .Item(cdoSendUsingMethod) = cdoSendUsingPickup .Item(cdoFlushBuffersOnWrite) = True .Item(cdoSMTPServerPickupDirectory) = "c:\temp" .Update End With Invoke the page and then open the .eml file created in c:\temp in a outlook express. Does it look ok? Open it with notepad. Post here the headers at the top the file and the headers preceeding the HTML body part. I'm especially interested in Content -Type, Char-set, Transfer-Encoding. -- Anthony Jones - MVP ASP/ASP.NET > Hello Anthony,> Invoke the page and then open the .eml file created in c:\temp in a outlook > express. Does it look ok? Open it with notepad. Post here the headers at > the top the file and the headers preceeding the HTML body part. I'm > especially interested in Content -Type, Char-set, Transfer-Encoding. > > -- > Anthony Jones - MVP ASP/ASP.NET Thanks for your help so far. I've changed the fields as you supposed. When I open the email in Outlook Express it seems okay there. As far as I can see the problems only occur at some email addresses, because when I send the same email to different addresses it's received good at some and mallformed at some other. Please find some headers here: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="---- =_NextPart_000_009E_01C816E9.523A6990" X-Mailer: Microsoft CDO for Windows 2000 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.2929 Content-Class: urn:content-classes:message This is a multi-part message in MIME format. ------=_NextPart_000_009E_01C816E9.523A6990 Content-Type: multipart/alternative; boundary="----=_NextPart_001_009F_01C816E9.523A6990" ------=_NextPart_001_009F_01C816E9.523A6990 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable I hope you can see anything strange here? regards, Jens Show quote
"Jens" <p.meg***@gmail.com> wrote in message There should be another part with the Content-Type:text/html further downnews:1193297781.471805.45780@k35g2000prh.googlegroups.com... > > > > Invoke the page and then open the .eml file created in c:\temp in a outlook > > express. Does it look ok? Open it with notepad. Post here the headers at > > the top the file and the headers preceeding the HTML body part. I'm > > especially interested in Content -Type, Char-set, Transfer-Encoding. > > > > -- > > Anthony Jones - MVP ASP/ASP.NET > > > Hello Anthony, > > Thanks for your help so far. > I've changed the fields as you supposed. When I open the email in > Outlook Express it seems okay there. > > As far as I can see the problems only occur at some email addresses, > because when I send the same email to different addresses it's > received good at some and mallformed at some other. > > Please find some headers here: > MIME-Version: 1.0 > Content-Type: multipart/mixed; boundary="---- > =_NextPart_000_009E_01C816E9.523A6990" > X-Mailer: Microsoft CDO for Windows 2000 > X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.2929 > Content-Class: urn:content-classes:message > > This is a multi-part message in MIME format. > > ------=_NextPart_000_009E_01C816E9.523A6990 > Content-Type: multipart/alternative; > boundary="----=_NextPart_001_009F_01C816E9.523A6990" > > ------=_NextPart_001_009F_01C816E9.523A6990 > Content-Type: text/plain; > charset="iso-8859-1" > Content-Transfer-Encoding: quoted-printable > the email can I see the headers for that? What you've posted above looks fine. -- Anthony Jones - MVP ASP/ASP.NET Show quote
On 25 okt, 10:32, "Anthony Jones" <A***@yadayadayada.com> wrote: Anthony,> "Jens" <p.meg***@gmail.com> wrote in message > > news:1193297781.471805.45780@k35g2000prh.googlegroups.com... > > > > > > > > > > Invoke the page and then open the .eml file created in c:\temp in a > outlook > > > express. Does it look ok? Open it with notepad. Post here the headers > at > > > the top the file and the headers preceeding the HTML body part. I'm > > > especially interested in Content -Type, Char-set, Transfer-Encoding. > > > > -- > > > Anthony Jones - MVP ASP/ASP.NET > > > Hello Anthony, > > > Thanks for your help so far. > > I've changed the fields as you supposed. When I open the email in > > Outlook Express it seems okay there. > > > As far as I can see the problems only occur at some email addresses, > > because when I send the same email to different addresses it's > > received good at some and mallformed at some other. > > > Please find some headers here: > > MIME-Version: 1.0 > > Content-Type: multipart/mixed; boundary="---- > > =_NextPart_000_009E_01C816E9.523A6990" > > X-Mailer: Microsoft CDO for Windows 2000 > > X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.2929 > > Content-Class: urn:content-classes:message > > > This is a multi-part message in MIME format. > > > ------=_NextPart_000_009E_01C816E9.523A6990 > > Content-Type: multipart/alternative; > > boundary="----=_NextPart_001_009F_01C816E9.523A6990" > > > ------=_NextPart_001_009F_01C816E9.523A6990 > > Content-Type: text/plain; > > charset="iso-8859-1" > > Content-Transfer-Encoding: quoted-printable > > There should be another part with the Content-Type:text/html further down > the email can I see the headers for that? What you've posted above looks > fine. > > -- > Anthony Jones - MVP ASP/ASP.NET- Tekst uit oorspronkelijk bericht niet weergeven - > > - Tekst uit oorspronkelijk bericht weergeven - Yes there are more headers, see below: ------=_NextPart_001_009F_01C816E9.523A6990 Content-Type: text/html Content-Transfer-Encoding: 8bit <html><head><meta HTTP-EQUIV="Content-Type" CONTENT="text/ html;charset=iso-8859-1"><title>Uw persoonlijke offerte per e-mail</ title></head><body BGColor="#FFFFFF" Text="#000000"><p>...</p></body></ html> ------=_NextPart_001_009F_01C816E9.523A6990-- ------=_NextPart_000_009E_01C816E9.523A6990 Content-Type: application/octet-stream; name="Dienstenwijzer.pdf" Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="Dienstenwijzer.pdf" Show quote
"Jens" <p.meg***@gmail.com> wrote in message Its the 8bit transfer encoding on the html part which is causing thenews:1193309680.498276.232910@57g2000hsv.googlegroups.com... > > Anthony, > Yes there are more headers, see below: > > ------=_NextPart_001_009F_01C816E9.523A6990 > Content-Type: text/html > Content-Transfer-Encoding: 8bit > > <html><head><meta HTTP-EQUIV="Content-Type" CONTENT="text/ > html;charset=iso-8859-1"><title>Uw persoonlijke offerte per e-mail</ > title></head><body BGColor="#FFFFFF" Text="#000000"><p>...</p></body></ > html> > ------=_NextPart_001_009F_01C816E9.523A6990-- > > ------=_NextPart_000_009E_01C816E9.523A6990 > Content-Type: application/octet-stream; > name="Dienstenwijzer.pdf" > Content-Transfer-Encoding: base64 > Content-Disposition: attachment; > filename="Dienstenwijzer.pdf" > problem. It should be quoted-printable like the plain text alternative part. I've come acroess this before on Win 2003 machines where CDO chooses 8bit encoding despite it being an in appropriate encoding for sending via SMTP. Trying adding this line before sending:- ..HTMLBodyPart.ContentTransferEncoding = "quoted-printable" -- Anthony Jones - MVP ASP/ASP.NET |
|||||||||||||||||||||||