extrme 0 Report post Posted February 20, 2008 asslmkm kwn2 semuasifoo2 n otai2 semua..nak tanya ni..ada saper2 ada coding tuk buat simple emel program guna vb.net visual studi0 2005acctually da jumpa sket coding dia..tp at last dia error msg kuar la.katanya yahoo xauthenticate aper ntahso xleh process la.saper2 bleh tolong amatlah dihargai..thanks.. Quote Share this post Link to post Share on other sites
ron 0 Report post Posted February 21, 2008 (edited) Maksud awak nak buat sendiri dari zero email software dan web sbg medium sprt Yahoo mail dan gmail?Kalau camtu kene paham dua konsep ni, send and receive. Send menggunakan protocol smtp dan receive meggunakan pop3. Untuk send / hantar tidak sesusah mana sbb MS dah siap buat library untuk anda just menggunakan library tersebut dlm .NET via smtp server dlm IIS. Tetapi jika untuk Receive / Terima, anda kene menggunakan pop3 untuk store inbox dan store kedalam database, dimana prosesnya agak rumit sedikit. Anda perlu tahu socket programming untuk membuat sendiri library / API sendiri sbb MS utk .NET tak provide library untuk tujuan tersebut. Namun ada 3rd party library kat internet yg kebanyakkan nya berbayar dan ada yg free tapi kurang stabil. Jika anda experience programmer anda boleh buat sendiri library untuk pop3 ni menggunakan .NET socket programming, very interesting actually. Kalau anda dah berjaya buat library ni dgn jayanya, dah kira boleh license kan dan jual dlm internet hehe. Edited February 21, 2008 by ron Quote Share this post Link to post Share on other sites
extrme 0 Report post Posted February 21, 2008 (edited) thank ron for reply..actually sy tau tu.. n sy bukn nk buat web basednk buat app.simple jer..macam app ni akan generate jpg file then attch trus nak anta ke emel.ni contoh coding yg tgh buat. tp xberapa bejaya la..menggunakan Visual Basic 2005 Express Editionsapa2 otai bole tolong.Private Sub send_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles send.Click 'Submit E-Mail on click of Button Dim theMailMessage As MailMessage = New MailMessage(from.Text, emelto.Text) Try 'Merge textBox1.Text and textBox2.Text Dim message1 As String message1 = "test msg" 'message1 += TextBox2.Text + Environment.NewLine 'Set the property of the message body and subject body theMailMessage.Body = message1 theMailMessage.Attachments.Add(New Attachment(TextBox6.Text)) theMailMessage.Subject = "E-Mail From Me " 'E-Mail Credentials and Sending 'Dim port As Integer Dim theClient As SmtpClient = New SmtpClient("smtp.mail.yahoo.com") Dim theCredential As System.Net.NetworkCredential = New System.Net.NetworkCredential("username", "password") theClient.Credentials = theCredential theClient.EnableSsl = True theClient.Port = 465 theClient.Timeout = 30000 'Send the email theClient.Send(theMailMessage) MessageBox.Show(("E-Mail Sent Successfully!" _ + (Environment.NewLine + "Thank You")), "Confirmation", MessageBoxButtons.OK) Catch smtpex As SmtpException MessageBox.Show(("An error occured when trying to send a mail. You appear to be disconnected from the Internet. Pleas" & _ "e confirm that you are connected to the Internet and Resubmit the data. " + smtpex.Message)) Catch ex As System.Exception MessageBox.Show(("An unexpected error occured. " + ex.Message)) End Try End Sub Edited February 21, 2008 by extrme Quote Share this post Link to post Share on other sites