Ovo je primjer koda za slanje mail-a pomocu EasyMail objekta. Ovaj kod sam mislio prebaciti u VBA za slanje jednog izvjestaja. Medjutim EasyMail nije besplatan. Zna li tko neki besplatan objekt slican EasyMail-u za slanje mail-a preko VBA.
Private Sub SendMail(strServer$, strFrom$, strTo$, strSubject$, strBodyText$)
Dim x%
Dim SMTP As Object
Set SMTP = CreateObject("EasyMail.SMTP")
SMTP.MailServer = strServer$
SMTP.FromAddr = strFrom$
SMTP.AddRecipient "", strTo$, 1
SMTP.Subject = strSubject$
SMTP.BodyText = strBodyText$
x% = SMTP.Send
If x% = 0 Then
MsgBox "Message sent successfully."
Else
MsgBox "There was an error sending your message. Error: " & CStr(x%)
End If
Set SMTP = Nothing
End Sub
Example usage:
SendMail "mail.yourdomain.com", "support@yourdomain.com", "jdoe@theirdomain.com", "This is the subject", "This is the body text."
Kod preuzet sa:
http://www.quiksoft.com/suppor...sp?ID=1015&Query_ID=545900








SMTP objekti za slanje mail-a iz VBA
Re: SMTP objekti za slanje mail-a iz VBA
Re: SMTP objekti za slanje mail-a iz VBA