I am sending emails thru Outlook object in VB6. At one stage it was sending the mails properly.
Suddenly 2 things have started happening in Outlook:

1. The default mail sending account is not geting used anymore. It shows blank there. I have set

the default settings as plain text and not to send immdly.

2. .Body of the mailitem shows its matter properly when i debug and check thru .display. But

finally when .send is executed and I see the email in Outlook outbox, it has no text in body.

I have checked that the Fildata variable which contains body text contains proper values. I am

showing the values thru messagebox and display as well. It displays properly, but once in Outlook

outbox, email body matter vanishes.

And very rarely, once in a while the body contents also stay and do not vanish. Its quite

erratic.

But sender details are always blank, even after having a valid default email account.

If somehow I attach a file using .Attachments.Add, that attachment stays properly.

3. I am using VB6, with Win Xp - pro.

4. I have even tried disabling firewall and scanning for virus etc.

5. Here's the part of the code:

VB Code:
  1. Private Sub DoMailingMSOutlook()
  2.  
  3.     Dim objOutlook As Object
  4.     Dim objOutlookMsg As Object
  5.    
  6.     'late binding method
  7.     Set objOutlook = CreateObject("Outlook.Application")
  8.        
  9.     ' we use zero argument as it is for new mail message
  10.     'Appointment  1;     'Contact 2;    'Distribution List 7
  11.     'Journal 4;     'Mail Message 0;     'Note 5    'Post 6;     'Task 3
  12.  
  13.     Set objOutlookMsg = objOutlook.CreateItem(0)
  14.     strSubject = "MF " & strPortfolio
  15.    
  16.     With objOutlookMsg
  17.          
  18.         .To = "[email protected]"
  19.         .Subject = strSubject
  20.         If FilDat = "" Then
  21.            MsgBox "No body text for '" & strPortfolio & "'", vbInformation, g_strPackage
  22.         Else
  23.             MsgBox "There is body text for '" & strPortfolio & "'", vbInformation, g_strPackage
  24.             MsgBox "Body text is: '" & FilDat & "'", vbInformation, g_strPackage
  25.            
  26.             .Body = FilDat
  27.             .Attachments.Add FilName
  28.            
  29.             .display
  30.         End If
  31.        
  32.         .Send
  33.     End With
  34.     Set objOutlookMsg = Nothing
  35.     Set objOutlook = Nothing
  36. End Sub

6. Any suggestions on code ? And why the dafault mail account is not geting pircked up ?

Rgds