Wrox Programmer Forums
Go Back   Wrox Programmer Forums > .NET > Other .NET > General .NET
|
General .NET For general discussion of MICROSOFT .NET topics that don't fall within any of the other .NET forum subcategories or .NET language forums.  If your question is specific to a language (C# or Visual Basic) or type of application (Windows Forms or ASP.Net) try an applicable forum category. ** PLEASE BE SPECIFIC WITH YOUR QUESTION ** When posting here, provide details regarding the Microsoft .NET language you are using and/or what type of application (Windows/Web Forms, etc) you are working in, if applicable to the question. This will help others answer the question without having to ask.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the General .NET 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 22nd, 2005, 09:04 AM
Authorized User
 
Join Date: Feb 2005
Posts: 91
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to ashokparchuri Send a message via Yahoo to ashokparchuri
Default how to send a mail

hi i want to send mail from my webpage using "smtp" pleasee tell me hoe to do that?


thanks in advance-Ashok Parchuri
 
Old March 22nd, 2005, 09:12 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,110
Thanks: 0
Thanked 3 Times in 3 Posts
Default

http://www.4guysfromrolla.com/webtech/080801-1.shtml

Try that.

 
Old March 24th, 2005, 07:55 AM
Authorized User
 
Join Date: Feb 2005
Posts: 14
Thanks: 0
Thanked 1 Time in 1 Post
Default

hi there, try this i have successfully done this,
first create four textboxes in a webform whose id s are like this
1.txtFrom
2.txtTo
3.txtSub
4.txtContent
now drag a button from toolbox to send mail
now try the following code

private void Button1_Click(object sender, System.EventArgs e)
        {
            SmtpMail.SmtpServer="localhost";
            mmsg=new MailMessage ();
            mmsg.From =txtFrom.Text ;
            mmsg.To =txtTo.Text;
            mmsg.Subject =txtSub.Text;
            mmsg.Body =txtContent.Text;
            mmsg.BodyFormat =MailFormat.Html;
            mmsg.Priority =MailPriority.High ;
            SmtpMail.Send(mmsg);

        }

Don't forget to include the namespace using System.Web.Mail;
also at the begining declare,after the start of the class
protected MailMessage mmsg;

Regards

somissac





Similar Threads
Thread Thread Starter Forum Replies Last Post
Send mail and attachments with PHP mail function Lofa Beginning PHP 1 June 2nd, 2008 03:24 PM
send mail chavakoti BOOK: Professional SQL Server 2005 Integration Services ISBN: 0-7645-8435-9 1 September 4th, 2007 05:03 AM
How to send mail Jolley_tolson PHP How-To 0 August 13th, 2007 03:38 AM
Cannot send mail rajanikrishna JSP Basics 3 March 17th, 2006 01:39 AM
The mail can't be send jabby General .NET 2 September 8th, 2004 05:14 AM





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