AppSettings "EmailID". Dim smtp As New SmtpClient. Send message. End Sub Now over to you:. Stay tuned and stay connected for more technical updates. Tweet Share Share Share.
Lalit Raghuvanshi Read More. Next « Prev Post. Previous Next Post ». Lalit Raghuvanshi admin. Conversion Clean. Subscribe to: Post Comments Atom. Now, move to the web. After adding the credentials, the app setting section of the web. Now add the separate class file by right-clicking on the Solution Explorer, however this is not necessary since you can also write this code in the default.
After writing the email sending logic code, the class file will look as in the following: In the preceding class file, we have created one simple static function to send the emails that takes three parameters that are: string ToEmail: recipient email id string Subj: subject of the email string Message: Email body or message Logic to add multiple recipient's Email Ids In the preceding class file I used a foreach loop to add the multiple recipient's Email Ids but before that we are using the comma , separated input email ids from user in one string "Tomail" then we are splitting the input sting with , commas and added to one string array named "Multi" then using a foreach loop we are adding each email id to the mailaddress.
I hope you have understood that. Now call the preceding static function on the button click of the "default. Now run the application and add the email details in all the text boxes and click on the send button as in: From the preceding example we learned how to send emails to multiple Recipients, I hope you have done it.
Note For detailed code please download the Zip file attached above. Don't forget to update the "Web. Net asp. Next Recommended Reading. Phil Lee NZ 3-Jul Phil Lee NZ Jul Go to top. Layout: fixed fluid. Software Developer. First Prev Next. Really Helpfull article Member 1-Jun Member This is really awesome. Thank you so much for giving this helpfull article.
0コメント