Email from Access Body displays Blank Body

TallMan

Registered User.
Local time
Today, 18:06
Joined
Dec 5, 2008
Messages
239
Hello,

Has anyone heard of this issue before? I have a database .mdb that sends out an email once a click box is selected. The email is sent out from an associate who is using 2007. If someone with office 2003 reads the email the body of the email is completely blank. If someone with office 2007 opens the email it is fine.

I am thinking this may be a reference issue. When I look in the reference window in the database (Access 2007) I am showing all the references in which I believe I need.


Visual basic for Applications
Microsoft outlook 12.0 object library
ole automation
Microsoft Activex data objects 2.1 library
Microsoft dao 3.6 Object library
microsoft scripting runtime

If I have the emails display on the senders screen using .display before sending them then the receiver with 2003 can see the body. That is my current work around but considering there are 150+ emails that go out I would love to figure this out.


:confused:Any ideas? :confused:

Thank you for your time.
 
chec k the 2003 library see what they say ...
and make sure the 2007 match the 2003 ones not try to do it the other way round
 
I think your problems lie elsewhere. If I understand you correctly.

You are saying that on one PC (PC 1) you have an access database with Outlook 2007. And this PC creates emails.

If these emails are read by a PC (PC 2) with office 2003 then the body of the email is blank.

If this is the case what happens when PC 1 sends an email just with Outlook? Is this readable by other Outlook 2003 users?

What format does Access make the email body?
 
Thank you for your response. You are understanding correctly. When an assocaite emails someone directly from outlook 2007 to a recipient with 2003 the emails are fine and the receiving person can read the email. So far every participant with 2003 outlook has not received a "normal" email from a 2007 outlook email when send through access.

I am not sure how to answer your question below:

"What format does Access make the email body?"
I thought the way the code/references work, whatever year operating system you are using it creates it in that format, I could of course be wrong.

Would you like me to post the code I am using?

Thanks again for your post, this is a complete mystery within my department!
 
Yep post your code as there must be something there.
 
Thanks again Darbid.

PLease see below:

PHP:
Public Function SendEMail()
Dim db As DAO.Database
Dim MyOutlook As Outlook.Application
Dim MyMail As Outlook.MailItem
Dim StrEmailList As String
Dim Subjectline As String
Dim BodyFile As String
Dim MasterString As String
Dim MailList As DAO.Recordset
Dim rs As DAO.Recordset
Dim fso As FileSystemObject
Dim MyBody As TextStream
Dim MyBodyText As String
Dim Count As Integer
 
Set fso = New FileSystemObject
Subjectline$ = "AMS Account Cancel Notice: Assets Transferred Out"
Set db = CurrentDb()

SQL = "Select Distinct FA_Email FROM BGC_Table Where FA_Email Is Not Null;"
Set MailList = db.OpenRecordset(SQL)
Do Until MailList.EOF
SQL2 = "Select * From BGC_Table Where FA_Email = '" & MailList!FA_Email & "';"
Count = 1
Set rs = db.OpenRecordset(SQL2)
While Not rs.EOF
If Count Mod 2 = 0 Then
                    StrEmailList = StrEmailList & _
                    "<tr class='tblOn'>"
                Else
                    StrEmailList = StrEmailList & _
                    "<tr class='tblOff'>"
                End If
StrEmailList = StrEmailList & "<td>" & rs!Account & "</td><td>" & rs!Client_Name & "</td><td>" & rs!Cxl_Date & "</td>"
Count = Count + 1
rs.MoveNext
DoEvents
Wend
MasterString = "<html><style type = 'text/css'> body {font-family: verdana, arial; font-size: 12px;}" & _
" table{890px; border-collapse: collapse; font-family: verdana; font-size: 12px;}" & _
" table th {background: #999999; color: #FFFFFF;}" & _
" table td {text-align: center; border: 1px solid #CECECE;}" & _
" table .headerCell {border: 0 px solid #FFFFFF; font-size: 13 px;}" & _
" table .tblON td {background: #EEEEEE;} table .tblOFF td {background: #FFFFFF;}" & _
"<body><p>This body of the email This body of the email This body of the email" & _
" This body of the email This body of the email This body of the email This body of the email  " & _
"This body of the email This body of the email This body of the email This body of the email  " & _
"This body of the email This body of the email This body of the email, " & _
"This body of the email This body of the email This body of the email This body of the email.<br/><br/>" & _
"<table cellpadding='5'><th>Account</th><th>Client Name</th><th>Cancel Date</th>" & StrEmailList & "</table>" & _
"This body of the email This body of the email This body of the email," & _
" This body of the emailThis body of the emailThis body of the emailThis body of the email." & _
"<br/><br/>Thank you,<br/><br/>department name here<br/>email address here" & _
"<br/></p></body></html>"
With objEmail
Set objOutlook = CreateObject("Outlook.Application")
Set objEmail = objOutlook.CreateItem(olMailItem)
.To = MailList("FA_Email")
.Subject = Subjectline$
.CC = "abc@blahblah.com"
.HTMLBody = MasterString
.Display
End With
MailList.MoveNext
StrEmailList = " "
MasterString = " "
DoEvents
Loop

Set MyMail = Nothing
Set MyOutlook = Nothing
MailList.Close
Set MailList = Nothing
db.Close
Set db = Nothing
End Function
 
i dont see anything wrong with that, although I cannot test it right now as I am not on a PC with Access. I would suggest you try it with a .Body instead of HTML and change MasterString to some text instead. I am guessing that the HTML is what is going wrong.
 

Users who are viewing this thread

Back
Top Bottom