Oliver1
Feb 1st, 2005, 06:27 AM
Hi this is a problem which I'm realy stuck on. For a bit of background we use Exchange 2003 as are mailserver and have outlook 2000 clients.
I have an e-mailer program which takes an e-mail it recives and forward it out again. The problem is we have a client complaing saying he only wants the e-mail we send him to be in plain text. If I send the program straight from Outlook it's fine, but for some reson when I use the below code to send an e-mail it's sent as both plain text and HTML, anyone now how to change this.
Private Function sendemail(todest As String, subject As String, body As String) As Boolean
On Error GoTo sendwarning:
Dim fnam As String
Dim loopcounter As Integer
loopcounter = 0
Set objMailitem = objApp.CreateItem(olMailItem)
If addatt Then
Set myatts = myitem.Attachments
If myatts.Count > 0 Then
Set myatts = myitem.Attachments
Set objattachments = objMailitem.Attachments
Do While loopcounter < myatts.Count
loopcounter = loopcounter + 1
Set myatt = myatts(loopcounter)
fnam = myatt.FileName
If Mid(fnam, 1, 4) = "Page" Then
fnam = Mid(fnam, 1, 11)
End If
myatt.SaveAsFile fnam
objattachments.Add (fnam)
Loop
Else
Set myatt = Nothing
End If
End If
objMailitem.To = todest
objMailitem.subject = subject
objMailitem.body = body
objMailitem.Send
sendemail = True
Exit Function
sendwarning:
sendemail = False
End Function
I have an e-mailer program which takes an e-mail it recives and forward it out again. The problem is we have a client complaing saying he only wants the e-mail we send him to be in plain text. If I send the program straight from Outlook it's fine, but for some reson when I use the below code to send an e-mail it's sent as both plain text and HTML, anyone now how to change this.
Private Function sendemail(todest As String, subject As String, body As String) As Boolean
On Error GoTo sendwarning:
Dim fnam As String
Dim loopcounter As Integer
loopcounter = 0
Set objMailitem = objApp.CreateItem(olMailItem)
If addatt Then
Set myatts = myitem.Attachments
If myatts.Count > 0 Then
Set myatts = myitem.Attachments
Set objattachments = objMailitem.Attachments
Do While loopcounter < myatts.Count
loopcounter = loopcounter + 1
Set myatt = myatts(loopcounter)
fnam = myatt.FileName
If Mid(fnam, 1, 4) = "Page" Then
fnam = Mid(fnam, 1, 11)
End If
myatt.SaveAsFile fnam
objattachments.Add (fnam)
Loop
Else
Set myatt = Nothing
End If
End If
objMailitem.To = todest
objMailitem.subject = subject
objMailitem.body = body
objMailitem.Send
sendemail = True
Exit Function
sendwarning:
sendemail = False
End Function