Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Mapi issue sending emails. winmail with a twist!!!

Status
Not open for further replies.

redsand

Programmer
Aug 15, 2001
45
0
0
US
I have a visual basic program that loops through an email table and sends out emails using MAPI. The problem is an age old one that I can not seem to figure out. Some of the users that I am sending to are getting a winmail.dat file instead of excel attachments. I have outlook 2000 and have changed the default send method to plain text. I do not have any contacts in my personal address book or contacts.
Here is the code
If File1.ListCount > 0 Then 'matching files found in the
MPMmessage.SessionID = MPSsession.SessionID
MPMmessage.Compose
MPMmessage.MsgSubject = "Weekly Sales Data from" "
MPMmessage.MsgNoteText = "This data"
MPMmessage.MsgIndex = -1
For ii = 0 To File1.ListCount - 1
ReDim Preserve sFound(UBound(sFound) + 1)
sFound(UBound(sFound) - 1) = sCurrPath & "\" & File1.List(ii)
nochange = sCurrPath & "\" & File1.List(ii)

'MPMmessage.AttachmentCount = File1.ListCount
MPMmessage.AttachmentIndex = ii
MPMmessage.AttachmentPosition = ii
MPMmessage.AttachmentPathName = nochange
MPMmessage.AttachmentName = File1.List(ii)

Next ii
If (ii) = File1.ListCount And (ii) <> 0 Then
'*************Get Email Address from Access****************
'Call GetEmail(CurrDir1, elist, email, Company)
strAppDir = CurrDir1
strDBName = strAppDir & &quot;SalesEmail.mdb&quot;
Set dbTable = OpenDatabase(strDBName)
Set rsField = dbTable.OpenRecordset(&quot;Select Email2,EmailName,Compname From tblEmail2 Where EmailName = '&quot; & elist & &quot;'&quot;)

With rsField
If Not rsField.EOF Then
Do Until rsField.EOF
DoEvents
email = rsField(&quot;Email2&quot;)
Company = rsField(&quot;Compname&quot;)
rsField.MoveNext
Loop
frmMapi.Refresh
frmMapi.Label3 = &quot;Sending &quot; & Company & &quot; Emails&quot;
frmMapi.Refresh

MPMmessage.RecipDisplayName = email
MPMmessage.RecipAddress = &quot;smtp:&quot; & email & &quot;&quot;
MPMmessage.MsgReceiptRequested = True
MPMmessage.Send True
------------------------------------

If MPMmessage.send is set to true I get a preview of the email. The email header says plain text. However if I right click the email address and go into properties the &quot;Always send to this recipient in ms outlook rich text&quot; is checked.

How can I default this to truely send as plain text. Do I have to set up these email addresses in my access table as contacts? Does this have something to do with me putting the smtp in front of the email address?(If I do not put smtp in front, the email sits in my outbox&quot;

Any help would be greatly appreciated. Thanks
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top