'----Send email
'----Jmail.dll can search the web for the next
Private Sub SendEmail ()
' Dim Sjmail as New jmail. SmtpMail
Dim Sjmail as Object
Dim Str as String
Dim Aryemail () as String
Dim I as Integer
Set Sjmail = CreateObject ("Jmail.smtpmail")
' My SMTP Server Address (uses default port=25)
Sjmail. serveraddress = "10.1.3.252" ' "<<address of your SMTP server>>"
Sjmail. ServerPort = 25
' My Name and Mail Address
Sjmail. Sender = "Erpadmin@mazen.com"
Sjmail. ReplyTo = "Erpadmin@mazen.com"
' Recipient Address and Name
str = getmailaddress ()
If str = "Then Exit Sub"
Aryemail = Split (str, ";")
' Receiver email, can be multiple
For i = 0 to UBound (aryemail)
If Trim (Aryemail (i)) > "Then Sjmail. AddRecipient Trim (Aryemail (i))
Next I
' Sjmail. AddRecipient "Abc@mazen.com"
' Compose message
Sjmail. Subject = "Report_data" title
Sjmail. Priority = 1
Sjmail. Body = "A010411_report_data" & Format (now, "yyyy-mm-dd") ' contents
Sjmail. AddAttachment "D:/a1.txt"
Sjmail. AddAttachment "D:/a2.txt"
' Send The Mail '
Sjmail. Execute
' Test for errors
If ERR <> 0 Then
MsgBox error$, vbcritical, "Mail Error"
End If
' Dispose Object
Set Sjmail = Nothing
End Sub