Why am I losing html formatting? 
Author Message
 Why am I losing html formatting?

I am sending html-formatted email via the Massmail add-in that parks
the mail in Outlook's outbox. I then use the following macro to send
the mail:

Sub ClearOutbox()
  Dim objFolder As Outlook.MAPIFolder
  Dim objOutItems As Outlook.Items
  Dim objItem As Object
  Dim lngItemCount As Long
  Dim lngLoopCounter As Long

  Set objFolder = Application.GetNamespace("MAPI").GetDefaultFolder(olFolderOutbox)
  Set objOutItems = objFolder.Items
  lngItemCount = objOutItems.Count

  For lngLoopCounter = lngItemCount To 1 Step -1
    Set objItem = objOutItems.Item(lngLoopCounter)
    objItem.Send
  Next
End Sub

For some reason, sending mail this way ends up in my hotmail test
account without proper html formatting (i.e. hyperlinks show up after
the text that was hyperlinked).

Any ideas why this macro would cause such behavior because when I
manually send mail to the same account, it's fine?

Peter



Mon, 15 Aug 2005 06:07:01 GMT  
 Why am I losing html formatting?
Peter:

Are you using Exchange?  I believe there is a setting in Exchange that will
convert HTML email to plain text if it is set up that way.

John


Quote:
> I am sending html-formatted email via the Massmail add-in that parks
> the mail in Outlook's outbox. I then use the following macro to send
> the mail:

> Sub ClearOutbox()
>   Dim objFolder As Outlook.MAPIFolder
>   Dim objOutItems As Outlook.Items
>   Dim objItem As Object
>   Dim lngItemCount As Long
>   Dim lngLoopCounter As Long

>   Set objFolder =

Application.GetNamespace("MAPI").GetDefaultFolder(olFolderOutbox)
Quote:
>   Set objOutItems = objFolder.Items
>   lngItemCount = objOutItems.Count

>   For lngLoopCounter = lngItemCount To 1 Step -1
>     Set objItem = objOutItems.Item(lngLoopCounter)
>     objItem.Send
>   Next
> End Sub

> For some reason, sending mail this way ends up in my hotmail test
> account without proper html formatting (i.e. hyperlinks show up after
> the text that was hyperlinked).

> Any ideas why this macro would cause such behavior because when I
> manually send mail to the same account, it's fine?

> Peter



Mon, 15 Aug 2005 10:31:28 GMT  
 Why am I losing html formatting?
And one more thing:

Hotmail's email facility is not like others when it comes to viewing HTML.

John


Quote:
> Peter:

> Are you using Exchange?  I believe there is a setting in Exchange that
will
> convert HTML email to plain text if it is set up that way.

> John



> > I am sending html-formatted email via the Massmail add-in that parks
> > the mail in Outlook's outbox. I then use the following macro to send
> > the mail:

> > Sub ClearOutbox()
> >   Dim objFolder As Outlook.MAPIFolder
> >   Dim objOutItems As Outlook.Items
> >   Dim objItem As Object
> >   Dim lngItemCount As Long
> >   Dim lngLoopCounter As Long

> >   Set objFolder =
> Application.GetNamespace("MAPI").GetDefaultFolder(olFolderOutbox)
> >   Set objOutItems = objFolder.Items
> >   lngItemCount = objOutItems.Count

> >   For lngLoopCounter = lngItemCount To 1 Step -1
> >     Set objItem = objOutItems.Item(lngLoopCounter)
> >     objItem.Send
> >   Next
> > End Sub

> > For some reason, sending mail this way ends up in my hotmail test
> > account without proper html formatting (i.e. hyperlinks show up after
> > the text that was hyperlinked).

> > Any ideas why this macro would cause such behavior because when I
> > manually send mail to the same account, it's fine?

> > Peter



Mon, 15 Aug 2005 10:43:34 GMT  
 Why am I losing html formatting?
Hi John:

Thanks for your message. How does Exchange distinguish between a
message sent by just clicking SEND versus sent by the VBA code?
Because the message sent by clicking SEND arrives at hotmail with html
intact, which would imply that Exchange is NOT set to convert HTML
mail to plain text. Plus the message I loop back to myself (Outlook
Corporate Client) survives with html intact.

Peter

Quote:

> Peter:

> Are you using Exchange?  I believe there is a setting in Exchange that will
> convert HTML email to plain text if it is set up that way.

> John



Tue, 16 Aug 2005 01:05:55 GMT  
 Why am I losing html formatting?
Peter,

So:

= Manual clicks of SEND arrive at Hotmail with good HTML
= Manual clicks of SEND to yourself arrive with good HTML
= VBA Sends to yourself arrive with good HTML
= VBA Sends to Hotmail arrive bollixed

Is that correct?

The only thing I can think of is that it is not the manual click that makes
things right, it is viewing the message in Outlook, like maybe the message
isn't in HTML format until you view it, presumably with HTML set as your
default message type.

I am grasping at straws.

One thing you could try, if this is Outlook 2002, objItem will have a
BodyFormat property that you can set to 2 ( HTML ).  You could try setting
that prior to .Send.

Outlook may give you Security dialogs if you try this, though.

What is Massmail?  Can't they help you?

John


Quote:
> Hi John:

> Thanks for your message. How does Exchange distinguish between a
> message sent by just clicking SEND versus sent by the VBA code?
> Because the message sent by clicking SEND arrives at hotmail with html
> intact, which would imply that Exchange is NOT set to convert HTML
> mail to plain text. Plus the message I loop back to myself (Outlook
> Corporate Client) survives with html intact.

> Peter




Quote:
> > Peter:

> > Are you using Exchange?  I believe there is a setting in Exchange that
will
> > convert HTML email to plain text if it is set up that way.

> > John



Tue, 16 Aug 2005 04:16:05 GMT  
 Why am I losing html formatting?
Hi John:

Yes, you've got it right. I just opened a go.com account and same
problem - manual sends OK, VBA sends bollixed (love that expression!)

Go.com lets you open the header and the good message contains:

Content-type: MULTIPART/ALTERNATIVE;
BOUNDARY="Boundary_(ID_BxopZ3md2SrvwdiBHceawQ)"

Whilst in the bad message, it's been changed to:

Content-type: text/plain; charset=iso-8859-1
Content-transfer-encoding: 7BIT

I'm using Outlook 2000 so I'm not able to modify objItem in anyway (that
I can see).

Thanks for your thoughts,

Peter

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!



Tue, 16 Aug 2005 05:19:55 GMT  
 
 [ 6 post ] 

 Relevant Pages 

1. OL2000 Msg Type // Re: Why am I losing html formatting?

2. Losing HTML Formatting in Send Window

3. HTML emails lose formatting

4. Am I Lost or What?

5. I am lost...

6. Saving HTML/rich format into HTML file

7. Can Some one help me, I am Lost

8. looks like I am losing events but ...

9. vb5 i am having problems with lost variables

10. Boy am I lost with this stuff - please help

11. Easy for you...I am lost!

12. Easy for you...I am lost!

 

 
Powered by phpBB® Forum Software