Page loading

Share your opinion
What do you think about gambaslinux.fr?
 
Interesting
It miss some informations
Excellent website
Results
WIDGETS GAMBAS
GAMBAS 3 SOFTWARES
TUTORIALS
Library
NETWORK - SMTPClient

USE THE SMTP COMPONENT TO SEND AN EMAIL

 


 

zemail.png
 
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
Last update : 09/01/2012 @ 16:50
Category : NETWORK
Page read 5014 times


Print the article Print the article


react.gifReactions to this article

Nobody gave a comment yet.
Be the first one to do it!


QUICK MENU
SEARCH




LANGUAGE
COMPONENTS
Other
LANGUAGE
Where, who?
VISITS

   visitors

   visitors online

ARCHIVES GAMBAS 1/2
^ Top ^