Share your opinion
WIDGETS GAMBAS
GAMBAS 3 SOFTWARES
TUTORIALS
Library
|
NETWORK - SMTPClient
USE THE SMTP COMPONENT TO SEND AN EMAIL
![]() Hi,
Today we learn to use smtp component to send an email with our little application. 1)Create interface. Create the interface with this parts : -tto textbox (who will receive this mail) tobject textbox (object of our mail) -tcontent textarea (content of our mail) bsend button (button to send our mail) bclose (quit our application) 2) Write this code in the bsend click event: PUBLIC SUB bsend_Click() SmtpClient1.To.Add(tto.Text) 'Who receive our message SmtpClient1.Subject = tobject.Text 'Object SmtpClient1.From = "lemail@lemail.fr"'address who send message SmtpClient1.Host = "smtp.free.fr" 'smtp server SmtpClient1.Port = 25 'port SmtpClient1.Add(tcontent.Text, "text/plain") 'content and type SmtpClient1.Send() 'send message Message.Info("Mail is sent!") 'message if it's ok CATCH Message("A error occured, send mail again or verify syntax !") END Thanks for your attention. Remark: If you have this error message : Server won't accept sender while starting dialog(smtp error code #575) The email address from you is in a invalid format (good format is :mail@mail.com) If you have signal #11 error, you have forgotten a line in this code. Verify syntax. Creation date : 09/01/2012 @ 16:44 ![]()
| QUICK MENU
SEARCH
LANGUAGE
COMPONENTS
Other
LANGUAGE
Where, who?
VISITS
ARCHIVES GAMBAS 1/2
|