|
| Program dr VB + dikirim ke email kita | |
| | Pengirim | Message |
---|
7.Riv.ID VIP Member
Jumlah posting : 353 Points : 569 Reputation : 31 Join date : 07.08.11 Age : 29 Lokasi : Magelang Cyber
| Subyek: Program dr VB + dikirim ke email kita Sun Jan 22, 2012 6:42 pm | |
| Gan ada yg tau gak gmn caranya buat form dr VisualBasic?? tp waktu kita isi form itu langsung otomatis ngirim ke email kita?? | |
| | | robofics VIP Member
Jumlah posting : 709 Points : 804 Reputation : 20 Join date : 22.12.11 Lokasi : /dev/null
| Subyek: Re: Program dr VB + dikirim ke email kita Tue Jan 24, 2012 1:24 pm | |
| - Code:
-
Option Explicit
Private DataAvailable As Boolean Private timer As Long Private Const TIME_OUT = 30 Dim inData As String Dim Reply As String Dim tmp() As String
Private Sub Form_Load() Dim i As Integer Dim str As String DataAvailable = False timer = 0 End Sub
Private Sub Check1_Click() Check1.Tag = IIf(Check1.Value = 1, "html;", "plain;") End Sub
Private Sub timer1_timer() timer = timer + 1 If timer = TIME_OUT Then CloseConn True 'Disconnect if timed out MsgBox "Could not connect to host " Timer1.Enabled = False End If End Sub
Private Sub cmdSend_Click() Winsock1.Connect "smtp.telkom.net", 25 End Sub
Private Sub Winsock1_Error(ByVal Number As Integer, Description As String, ByVal Scode As Long, ByVal Source As String, ByVal HelpFile As String, ByVal HelpContext As Long, CancelDisplay As Boolean) If Not Number = sckSuccess Then MsgBox Description 'Display error Timer1.Enabled = False CloseConn True End If End Sub
Private Sub Winsock1_DataArrival(ByVal bytesTotal As Long) Dim Data As String Winsock1.GetData Data, vbString inData = inData + Data If StrComp(Right$(inData, 2), vbCrLf) = 0 Then DataAvailable = True End Sub
Private Sub Winsock1_Connect() Label3.Caption = "Connected"
timer = 0 Timer1.Enabled = True
SendData "", 220 Label3.Caption = "Receiving Welcome Message"
SendData "HELO " + Winsock1.LocalHostName + vbCrLf SendData "MAIL FROM:<" + txtSender.Text + ">" + vbCrLf SendData "RCPT TO:<" + txtReceiver.Text + ">" + vbCrLf
'Send DATA DoEvents SendData "DATA" + vbCrLf, 354 Label3.Caption = "Sending Mail . . ."
'Send the E-Mail Winsock1.SendData "From: <" + txtSender.Text + ">" + vbCrLf + _ "To: " + txtReceiver.Text + vbCrLf + _ "Subject: " + txtSubject.Text + vbCrLf + _ "X-Mailer: VBMail v1.1" + vbCrLf + _ "Mime-Version: 1.0" + vbCrLf + _ "Content-Type: text/" + Check1.Tag + vbTab + "charset=us-ascii" + vbCrLf + vbCrLf + _ txtMessage.Text SendData vbCrLf + "." + vbCrLf
Winsock1.SendData "QUIT" Label3.Caption = "Message Sent" CloseConn False
End Sub
Private Sub SendData(Optional Data As String, Optional Number As Double = 250)
If Data <> "" Then Winsock1.SendData Data DoEvents timer = 0 Timer1.Enabled = True End If
While Not DataAvailable If Winsock1.State = sckClosed Then Exit Sub DoEvents Wend
Timer1.Enabled = False
Reply = inData inData = "" DataAvailable = False tmp = Split(Reply, " ")
If Not Val(tmp(0)) = Number Then 'Error occured MsgBox "Server returned the following error:" + vbCrLf + Reply CloseConn False Exit Sub End If
End Sub
Private Sub CloseConn(Err As Boolean) Winsock1.Close End Sub CMIIW | |
| | | digitalcat BC Security
Jumlah posting : 451 Points : 710 Reputation : 28 Join date : 31.10.11 Age : 42
| Subyek: Re: Program dr VB + dikirim ke email kita Tue Jan 24, 2012 1:45 pm | |
| | |
| | | Sponsored content
| Subyek: Re: Program dr VB + dikirim ke email kita | |
| |
| | | | Program dr VB + dikirim ke email kita | |
|
Similar topics | |
|
| Permissions in this forum: | Anda tidak dapat menjawab topik
| |
| |
| Latest topics | » Baktrack TutorialSun Jul 28, 2019 2:26 am by kenta » aplikasi gambas pada linuxTue Apr 30, 2019 10:28 am by kenta » beli linux ubuntu terbaru di surabayaSun Mar 31, 2019 10:08 am by kenta » desain robotFri Jan 19, 2018 1:25 pm by kenta » membuat robot tidak susahFri Jan 19, 2018 1:15 pm by kenta » Salam.. Salam.. Salam..Thu Nov 30, 2017 7:42 am by BumiayuKita» teknologi penyaring udara dan airWed Oct 04, 2017 8:41 am by kenta » [CloudMILD] VPS SSD IIX 2X RAM + Xtra SSD SpaceMon Jul 24, 2017 10:46 am by BumiayuKita» cara menutup akses dari situs negatifTue Apr 04, 2017 1:04 pm by kenta » Aplikasi Google TalkMon Mar 20, 2017 3:00 am by BumiayuKita» Driver buat Webcam PC ?? merknya M-Tech,, Fri Jan 30, 2015 8:51 pm by aelgrim » Portal Blog,,,,,Sun Dec 14, 2014 12:38 am by robofics» Appteknodroid - Seputar Dunia AndroidMon Nov 10, 2014 11:32 pm by Pr0phecy » Software animasi yang agan2 pakeTue Sep 30, 2014 1:11 pm by X_campus » INDO BILLING 6.70 + KEYSun Sep 21, 2014 2:17 pm by abdul halim |
Statistics | Total 12294 user terdaftar User terdaftar terakhir adalah Adlygans
Total 31710 kiriman artikel dari user in 5734 subjects
|
Banner Forum | Dukung forum Blackc0de dengan memasang bannernya.
|
Social Networking |
|
|