Mengirim Email via Foxpro

biar keren judulnya hehe, ok langung aja yaa kita akan kirim email dapat referen dari sini http://www.w3schools.com/asp/asp_send_email.asp

 

koding foxpronya


LOCAL myMail as "CDO.Message"
myMail = CreateObject("CDO.Message")
myMail.Subject = "Link 'tausyiah' "
myMail.From = "atmanegara1989@gmail.com"
myMail.To = "atma_1989@yahoo.com"
myMail.TextBody = "Bro ini file kumpulan video 'tausyiah' "
myMail.AddAttachment("D:\fileku.txt")

myMail.Configuration.Fields.Item;
("http://schemas.microsoft.com/cdo/configuration/sendusername") = 'atmanegara1989@gmail.com'
myMail.Configuration.Fields.Item;
("http://schemas.microsoft.com/cdo/configuration/sendpassword") = '***********'
myMail.Configuration.Fields.Item ;
("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2

myMail.Configuration.Fields.Item ;
("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "smtp.gmail.com"

myMail.Configuration.Fields.Item;
("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 465

myMail.Configuration.Fields.Item;
("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = 1
myMail.Configuration.Fields.Item;
("http://schemas.microsoft.com/cdo/configuration/smtpusessl") = .t.
myMail.Configuration.Fields.Update
lcError=0
TRY
myMail.Send
CATCH TO err
lcError=err.ErrorNo
IF lcError=1429
MESSAGEBOX("Username & Password tidak sesuai atau Koneksi Internet Bermasalah..!!",0+16,"Kesalahan")
ELSE
MESSAGEBOX("Telah terjadi kesalahan..!!",0+16,"Kesalahan")
ENDIF
FINALLY
IF lcError=0
MESSAGEBOX("Email Success...!!",64,"Informasi",30)
ELSE
MESSAGEBOX("Email Unsuccess...!!",64,"Informasi",30)
ENDIF
ENDTRY

terus jalankan kan, jika terkirim

dan hasilnya

emailpng

sukses juga yaa

[edit]

btw ketinggalan, krn pake gmail, maka diperlukan akses ke gmail dari aplikasi yang teknologinya kurang aman kata google ,settingnya dari gmail,
sini linknya, pastikan login dulu biar email kita tersetting

https://support.google.com/accounts/answer/6010255

emailpng

untuk cari ip/server smtp dan portnya bisa cek disini

https://www.arclab.com/en/kb/email/list-of-smtp-and-pop3-servers-mailserver-list.html

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: