Kevin Mortimer
Programmer
I have a simple vbscript which sends an email through outlook. The vbscript works fine on most machines except one machine which returns an error of 462. Can anyone help me resolve this issue.
Code:
Dim OutApp
Dim objNS
Dim OutMail
Dim strbody
Dim SigString
Dim Signature
Set OutApp = CreateObject("Outlook.Application")
Set objNS = OutApp.GetNamespace("MAPI")
OutApp.Session.Logon
Set OutMail = OutApp.CreateItem(0)
newsignature = Replace( "<html><head><meta http-equiv=Chr(34)Content-
TypeChr(34) content=Chr(34)text/html; charset=utf-8Chr(34)></head><body>
<font face=Chr(34)TahomaChr(34)><font size=2>Dear<br><br><br><br>Kind
regards</font></font> <br><br> </body></html>", "Chr(34)", """")
On Error Resume Next
With OutMail
.To = "kevin@inlinesolutions.co.za"
.CC = ""
.BCC = ""
.Subject = "test"
.HTMLBody = newsignature
Err.Clear
.Attachments.Add("C:\Users\Kevin Mortimer\Desktop\62983.pdf")
If Err.Number <> 0 Then
MsgBox "Error Attaching Document:( " & Err.Number & " ) " & Err.Description
Err.Clear
End If
.Send
End With
On Error GoTo 0
Set Signature = Nothing
Set SigString = Nothing
Set strBody = Nothing
Set OutMail = Nothing
Set objNS = Nothing
Set OutApp = Nothing