-
1
- #1
I found that the MS updates were often causing issues with sending mail using Office XP (Bypassing the security dll's didn't seem to be the best way to handle it) So I set out to find a way to email without using Outlook.
I found a command line SMTP emailer that was open source called Blat. It also supports attachments!!
It is available here -=>
(To use this requires that you have access to a SMTP
server.)
Here is an example of simple code to call it
'------------------------------------------------------------
' sendmail
'
'------------------------------------------------------------
Function sendmail()
On Error GoTo sendmail_Err
Dim msg As String
Dim subj As String
Dim addr As String
Dim file As String
'addr - email address fully qualified
addr = "somebody@somewhere.com"
'file - this is the attached report of the run
file = "c:\runlog.doc"
'msg file this is the text of the message
msg = "c:\msg.txt"
'subject line
subj = "MDB_COMPACT_LOG"
' send mail using Blat mailer
Call Shell("blat " & msg & " -to " & addr & " -subject " & subj & " -hostname maildaemon -attach " & file, 1)
sendmail_Exit:
Exit Function
sendmail_Err:
MsgBox Error$
Resume sendmail_Exit
End Function
Currently I am using this to mail a report with the status of an automated repair and compact job.
Hope this helps someone!
I found a command line SMTP emailer that was open source called Blat. It also supports attachments!!
It is available here -=>
(To use this requires that you have access to a SMTP
server.)
Here is an example of simple code to call it
'------------------------------------------------------------
' sendmail
'
'------------------------------------------------------------
Function sendmail()
On Error GoTo sendmail_Err
Dim msg As String
Dim subj As String
Dim addr As String
Dim file As String
'addr - email address fully qualified
addr = "somebody@somewhere.com"
'file - this is the attached report of the run
file = "c:\runlog.doc"
'msg file this is the text of the message
msg = "c:\msg.txt"
'subject line
subj = "MDB_COMPACT_LOG"
' send mail using Blat mailer
Call Shell("blat " & msg & " -to " & addr & " -subject " & subj & " -hostname maildaemon -attach " & file, 1)
sendmail_Exit:
Exit Function
sendmail_Err:
MsgBox Error$
Resume sendmail_Exit
End Function
Currently I am using this to mail a report with the status of an automated repair and compact job.
Hope this helps someone!