rianto isaac's Weblog

rianto utomo isaac sahala utomo

vb, kirim email

leave a comment »

Private Sub Command1_Click()

    Dim oSmtp As New EASendMailObjLib.Mail
    oSmtp.LicenseCode = "TryIt"

    ' Set your sender email address
    oSmtp.FromAddr = "test@emailarchitect.net"

    ' Add recipient email address
    oSmtp.AddRecipientEx "support@emailarchitect.net", 0

    ' Set email subject
    oSmtp.Subject = "simple email from VB 6.0 project"

    ' Set email body
    oSmtp.BodyText = "this is a test email sent from VB 6.0 project, do not reply"

    ' Your SMTP server address
    oSmtp.ServerAddr = "smtp.emailarchitect.net"

    ' Set SSL 465 port
    oSmtp.ServerPort = 465

    ' Set direct SSL connection
    oSmtp.SSL_starttls = 0
    oSmtp.SSL_init

    ' User and password for ESMTP authentication, if your server doesn't require
    ' User authentication, please remove the following codes.
    oSmtp.UserName = "test@emailarchitect.net"
    oSmtp.Password = "testpassword"

    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

untuk selengkapnya saya juga nyontek dari sini http://www.emailarchitect.net/easendmail/kb/vb.aspx

Installation

Before you can use the following sample codes, you should download the EASendMail Installer and install it on your machine at first.
http://www.emailarchitect.net/webapp/download/easendmail.exe

Written by isaaconi

September 18, 2012 pada 1:51 pm

Tinggalkan Balasan

Isikan data di bawah atau klik salah satu ikon untuk log in:

Logo WordPress.com

You are commenting using your WordPress.com account. Logout / Ubah )

Gambar Twitter

You are commenting using your Twitter account. Logout / Ubah )

Foto Facebook

You are commenting using your Facebook account. Logout / Ubah )

Foto Google+

You are commenting using your Google+ account. Logout / Ubah )

Connecting to %s

%d blogger menyukai ini: