Click here to Skip to main content
15,920,896 members
Home / Discussions / ASP.NET
   

ASP.NET

 
GeneralRe: How can i do it? Pin
Fujiwara Gili6-Oct-09 0:43
Fujiwara Gili6-Oct-09 0:43 
QuestionAjax UpdatePanel Not Responding Pin
helloshivshankar3-Oct-09 4:01
helloshivshankar3-Oct-09 4:01 
QuestionPrint page on client side contained in a folder by asp.net Pin
11Developer3-Oct-09 2:34
11Developer3-Oct-09 2:34 
AnswerRe: Print page on client side contained in a folder by asp.net Pin
mr_muskurahat3-Oct-09 2:39
mr_muskurahat3-Oct-09 2:39 
GeneralRe: Print page on client side contained in a folder by asp.net Pin
11Developer3-Oct-09 2:46
11Developer3-Oct-09 2:46 
GeneralRe: Print page on client side contained in a folder by asp.net Pin
sashidhar3-Oct-09 2:58
sashidhar3-Oct-09 2:58 
GeneralRe: Print page on client side contained in a folder by asp.net Pin
Christian Graus3-Oct-09 11:00
protectorChristian Graus3-Oct-09 11:00 
Questionsending email from local host Pin
kuduva3-Oct-09 2:34
kuduva3-Oct-09 2:34 
hi to all pls help me

i used this code to send a mail from webpage i didn't used any web server
i just run the program in my localhost this script not working it show sending mail failed any one can you pls explain this

my ultimate aim is to send a feedback form to my mail id


using System;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;
using System.Net.Mail;

public partial class _Default : System.Web.UI.Page 
{
    #region  "Send email"
    protected void btnSendmail_Click(object sender, EventArgs e)
    {
        // System.Web.Mail.SmtpMail.SmtpServer is obsolete in 2.0
        // System.Net.Mail.SmtpClient is the alternate class for this in 2.0
        SmtpClient smtpClient = new SmtpClient();
        MailMessage message = new MailMessage();

        try
        {
            MailAddress fromAddress = new MailAddress(txtEmail.Text, txtName.Text);

            // You can specify the host name or ipaddress of your server
            // Default in IIS will be localhost 
            smtpClient.Host = "localhost";

            //Default port will be 25
            smtpClient.Port = 25;

            //From address will be given as a MailAddress Object
            message.From = fromAddress;

            // To address collection of MailAddress
            message.To.Add("kn.nageshwaran@gmail.com");
            message.Subject = "Feedback";

            // CC and BCC optional
            // MailAddressCollection class is used to send the email to various users
            // You can specify Address as new MailAddress("admin1@yoursite.com")
            message.CC.Add("admin1@yoursite.com");
            message.CC.Add("admin2@yoursite.com");

            // You can specify Address directly as string
            message.Bcc.Add(new MailAddress("admin3@yoursite.com"));
            message.Bcc.Add(new MailAddress("admin4@yoursite.com"));

            //Body can be Html or text format
            //Specify true if it  is html message
            message.IsBodyHtml = false;

            // Message body content
            message.Body = txtMessage.Text;
         
            // Send SMTP mail
            smtpClient.Send(message);

            lblStatus.Text = "Email successfully sent.";
        }
        catch (Exception ex)
        {
            lblStatus.Text = "Send Email Failed.<br>" + ex.Message;
        }
    }
    #endregion

    #region "Reset"
    protected void btnReset_Click(object sender, EventArgs e)
    {
        txtName.Text = "";
        txtMessage.Text = "";
        txtEmail.Text = "";
    }
    #endregion
}

AnswerRe: sending email from local host Pin
sashidhar3-Oct-09 2:40
sashidhar3-Oct-09 2:40 
AnswerRe: sending email from local host Pin
Manas Bhardwaj3-Oct-09 2:41
professionalManas Bhardwaj3-Oct-09 2:41 
QuestionReplication Pin
Learner5203-Oct-09 0:25
Learner5203-Oct-09 0:25 
QuestionHow i can solve this sub menu enable false ? Pin
Rahad Rahman3-Oct-09 0:19
professionalRahad Rahman3-Oct-09 0:19 
AnswerRe: How i can solve this sub menu enable false ? Pin
sashidhar3-Oct-09 1:20
sashidhar3-Oct-09 1:20 
Questionadd scrolbar and horizantalbar bar to repeater control Pin
paya1pa3-Oct-09 0:08
paya1pa3-Oct-09 0:08 
AnswerRe: add scrolbar and horizantalbar bar to repeater control Pin
CoderOnline3-Oct-09 1:57
CoderOnline3-Oct-09 1:57 
AnswerRe: add scrolbar and horizantalbar bar to repeater control Pin
sashidhar3-Oct-09 2:01
sashidhar3-Oct-09 2:01 
QuestionSending Mail Through Default SMTP Virtual Server Pin
User 62554642-Oct-09 23:03
User 62554642-Oct-09 23:03 
AnswerRe: Sending Mail Through Default SMTP Virtual Server Pin
Manas Bhardwaj2-Oct-09 23:08
professionalManas Bhardwaj2-Oct-09 23:08 
AnswerRe: Sending Mail Through Default SMTP Virtual Server Pin
Christian Graus2-Oct-09 23:10
protectorChristian Graus2-Oct-09 23:10 
GeneralRe: Sending Mail Through Default SMTP Virtual Server Pin
User 62554642-Oct-09 23:38
User 62554642-Oct-09 23:38 
GeneralRe: Sending Mail Through Default SMTP Virtual Server Pin
Christian Graus2-Oct-09 23:43
protectorChristian Graus2-Oct-09 23:43 
GeneralRe: Sending Mail Through Default SMTP Virtual Server Pin
User 62554642-Oct-09 23:46
User 62554642-Oct-09 23:46 
GeneralRe: Sending Mail Through Default SMTP Virtual Server Pin
Christian Graus2-Oct-09 23:53
protectorChristian Graus2-Oct-09 23:53 
Questionslide show control Pin
rinku soni 232-Oct-09 22:19
rinku soni 232-Oct-09 22:19 
AnswerRe: slide show control Pin
Abhijit Jana2-Oct-09 22:26
professionalAbhijit Jana2-Oct-09 22:26 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.