Thursday, October 11, 2012

Nike Shox Torch 2 Vb .net Tutorial_13145

The days when working in classic VB, sending email is not that much easy as we do in asp.net. Email is the best notifications to communicate. Normally the SMTP server will be in remotely available application server. In this scenario we need to configure CDO to use our SMTP server. Then only the mail relay will be successful.
The function we are discussing will support most of the email functionalities like CC, BCC and attachment.

The function will return the status about sent. Since this function is designed for applications, the related settings can be fetched from settings file rather than changing the code and re compiling to take changes.

Basically the following configurations are necessary before sending mail with CDO object
?CDO.Message
?CDO.Configuration
CDO.Message
This object is used to set the various properties like following
?To
?From
?Subject
?TextBody
?Attachment
?CC
?BCC
Finally we can call the Send method to send the mail.
CDO.Configuration
This object is used to set the configurations like
?Send using
?SMTP server
?SMTP server port
To resolve "The transport failed to connect to the server"
Please change the respective SMTP server in the "change your SMTP server here" section. Or else you will get the "The transport failed to connect to the server." error message.
Most of my applications are using this function which needs SMTP Authentication. In order for this function to work, you must have a valid SMTP server with a valid user name and password.
It happened to me that my user account was locked or grey listed once since I have tried several times with bad password. Then the setting won�t work for a while until it gets released. So it is better if you have any doubts, use any utilities which may help to test the email before using this function. So make sure you have valid credentials and information regarding the SMTP server before using this function.

For source codes please refer VBNetTutorial.Net

相关的主题文章:

No comments:

Post a Comment