Wrox Programmer Forums
BOOK: Beginning VB.NET 2nd Edition/Beginning VB.NET 2003
This is the forum to discuss the Wrox book Professional VB.NET 2003 by Bill Evjen, Billy Hollis, Rockford Lhotka, Tim McCarthy, Jonathan Pinnock, Rama Ramachandran, Bill Sheldon; ISBN: 9780764559921
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning VB.NET 2nd Edition/Beginning VB.NET 2003 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
Old March 30th, 2006, 11:42 AM
Thearon's Avatar
Wrox Author
Join Date: Dec 2003
Posts: 396
Thanks: 0
Thanked 8 Times in 8 Posts

Imports System.Web.Mail

            'Declare a MailMessage object
            Dim objMailMessage As New MailMessage

            'Set the message properties
            objMailMessage.To = emailAddresses
            objMailMessage.From = fromAddress
            objMailMessage.Subject = subject
            objMailMessage.BodyFormat = MailFormat.Html
            objMailMessage.Body = body

            'Set the SmtpMail properties and send the mail message
            SmtpMail.SmtpServer = mailServer

            'Clean up
            objMailMessage = Nothing

Declare and set variables for emailAddresses, fromAddress, subject, body, and mailServer. Multiple email addresses can be specified and should be separated with a semicolon.

I hope this helps.

Old March 31st, 2006, 08:12 AM
Registered User
Join Date: Mar 2006
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to Punit Singh

hi Thearon,
 I tried this namespace.
 Imports System.Web.Mail
 I am using vs.net 2005, so it tells me that this namespace is obsolete now.
it tells me to use System.Net.Mail namespace.

Actually my coding is working now, but mail reaches to destination after long delay(after 3 to 4 hours).

so please tell me what to do.
thanks again for the code.

Punit singh
Old March 31st, 2006, 11:56 AM
Thearon's Avatar
Wrox Author
Join Date: Dec 2003
Posts: 396
Thanks: 0
Thanked 8 Times in 8 Posts

I'm glad your code is working. The code snippet that I provided was from Visual Studio 2003. Since your code is working and your mail is reaching its destination, it sounds like network problems somewhere. Since I'm not a network person you'll have to get with your network folks to try and track this down.


Similar Threads
Thread Thread Starter Forum Replies Last Post
Urgent: Excel and Vb 6.0 ivanlaw Pro VB 6 5 October 22nd, 2007 03:34 AM
Urgent :VB ivanlaw Pro VB Databases 19 August 31st, 2007 08:09 PM
New to VB/Database (Urgent) FrancisEnem VB Databases Basics 3 December 11th, 2006 03:11 PM
Urgent VB form Migration to VB.net form kvenkat_2k1 Pro VB.NET 2002/2003 1 December 7th, 2005 04:58 PM
Biztalk Project in VB.Net( Urgent) sathak General .NET 0 August 29th, 2004 07:59 AM

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.