Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Visual Basic > VB.NET 1.0 > Pro VB.NET 2002/2003
Pro VB.NET 2002/2003 For advanced Visual Basic coders working .NET version 2002/2003. Beginning-level questions will be redirected to other forums, including Beginning VB.NET.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Pro VB.NET 2002/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 May 16th, 2004, 08:50 PM
Authorized User
Join Date: Jul 2003
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to hplim18
Default Sending Email from VB.NET not using outlook

Creating mail and sending mail using outlook is common thing in VB.NET. Does anyone know other ways of sending e-mail by not using outlook?

For example that i can create my own component to create and sending mail to the users.

Old May 17th, 2004, 03:11 AM
Authorized User
Join Date: Jun 2003
Posts: 63
Thanks: 0
Thanked 0 Times in 0 Posts


Have a look at system.web.mail, the code extract is a console app

I know this is in c# but will easliy translate to VB
using System;
using System.Web.Mail;

namespace WebMail {
    class Class1 {
        static void Main(string[] args) {
            try {
                MailMessage oMsg = new MailMessage();
                // TODO: Replace with sender e-mail address.
                oMsg.From = "<insert email address>";
                // TODO: Replace with recipient e-mail address.
                oMsg.To = "<insert email address>";
                oMsg.Subject = "Send Using Web Mail";

                // SEND IN HTML FORMAT (comment this line to send plain text).
                oMsg.BodyFormat = MailFormat.Html;

                // HTML Body (remove HTML tags for plain text).
                oMsg.Body = "<HTML><BODY><B>Hello World!</B></BODY></HTML>";

                // ADD AN ATTACHMENT.
                // TODO: Replace with path to attachment.
                String sFile = @"C:\temp\test.doc";
                MailAttachment oAttch = new MailAttachment(sFile, MailEncoding.Base64);


                // TODO: Replace with the name of your remote SMTP server.
                SmtpMail.SmtpServer = "<insert smtp adddress>";

                oMsg = null;
                oAttch = null;
            catch (Exception e) {
                Console.WriteLine("{0} Exception caught.", e);

Old November 23rd, 2008, 04:38 AM
Posts: n/a

go through the following link , it will show hot to send SMTP eamil.



Similar Threads
Thread Thread Starter Forum Replies Last Post
Sending email in VB.net lowell .NET Framework 2.0 3 November 30th, 2008 11:51 AM
Problem sending email with SMTP in VB.Net Compiler Forum and Wrox.com Feedback 3 November 30th, 2007 07:25 PM
sending an email from a vb.net app badgolfer VB.NET 2002/2003 Basics 1 March 7th, 2005 09:27 PM
Sending email thru Outlook Exp. from VB with html rambhias Beginning VB 6 4 November 22nd, 2004 03:12 AM
Sending an email without Outlook SaharaWizard Pro VB 6 3 August 12th, 2004 04:15 PM

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