Click here to Skip to main content
16,014,392 members
Home / Discussions / ASP.NET
   

ASP.NET

 
GeneralRe: crystal report connection string from web.config Pin
Christian Graus1-Oct-09 21:14
protectorChristian Graus1-Oct-09 21:14 
QuestionViewState or Global variable Pin
Xmen Real 1-Oct-09 16:05
professional Xmen Real 1-Oct-09 16:05 
AnswerRe: ViewState or Global variable Pin
Christian Graus1-Oct-09 16:38
protectorChristian Graus1-Oct-09 16:38 
Questiononline forms in asp.net Pin
kuduva1-Oct-09 8:31
kuduva1-Oct-09 8:31 
AnswerRe: online forms in asp.net Pin
Abhijit Jana1-Oct-09 8:46
professionalAbhijit Jana1-Oct-09 8:46 
GeneralRe: online forms in asp.net Pin
kuduva1-Oct-09 10:16
kuduva1-Oct-09 10:16 
GeneralRe: online forms in asp.net Pin
Abhijit Jana1-Oct-09 10:39
professionalAbhijit Jana1-Oct-09 10:39 
GeneralRe: online forms in asp.net Pin
kuduva1-Oct-09 10:49
kuduva1-Oct-09 10:49 
Thanks to reply

where i have to put email id in that code

i host that demo file in my server but its say mail not send
so only i ask where i have to put to address (email id) in that code

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("admin1@yoursite.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

}


in this where i have to give my email id

when i upload this code i have to change any to execute
GeneralRe: online forms in asp.net Pin
Abhijit Jana1-Oct-09 10:55
professionalAbhijit Jana1-Oct-09 10:55 
GeneralRe: online forms in asp.net Pin
kuduva1-Oct-09 10:59
kuduva1-Oct-09 10:59 
GeneralRe: online forms in asp.net Pin
Abhijit Jana1-Oct-09 11:03
professionalAbhijit Jana1-Oct-09 11:03 
GeneralRe: online forms in asp.net Pin
kuduva1-Oct-09 11:04
kuduva1-Oct-09 11:04 
AnswerRe: online forms in asp.net Pin
Abhijit Jana1-Oct-09 11:17
professionalAbhijit Jana1-Oct-09 11:17 
GeneralRe: online forms in asp.net Pin
Xmen Real 1-Oct-09 16:14
professional Xmen Real 1-Oct-09 16:14 
Questionusing backend variables in html code Pin
laziale1-Oct-09 6:35
laziale1-Oct-09 6:35 
AnswerRe: using backend variables in html code Pin
Abhishek Sur1-Oct-09 8:09
professionalAbhishek Sur1-Oct-09 8:09 
Question[Message Deleted] Pin
JFK1011-Oct-09 4:19
JFK1011-Oct-09 4:19 
AnswerRe: ComboBox edit restrict to certain users. Pin
Abhishek Sur1-Oct-09 4:54
professionalAbhishek Sur1-Oct-09 4:54 
General[Message Deleted] Pin
JFK1011-Oct-09 5:53
JFK1011-Oct-09 5:53 
GeneralRe: ComboBox edit restrict to certain users. Pin
Abhishek Sur1-Oct-09 6:07
professionalAbhishek Sur1-Oct-09 6:07 
AnswerRe: [Message Deleted] Pin
Abhijit Jana1-Oct-09 7:26
professionalAbhijit Jana1-Oct-09 7:26 
QuestionWeb Service Response Issue Pin
prabhakar dwivedi1-Oct-09 2:45
prabhakar dwivedi1-Oct-09 2:45 
AnswerRe: Web Service Response Issue Pin
Abhijit Jana1-Oct-09 2:56
professionalAbhijit Jana1-Oct-09 2:56 
GeneralRe: Web Service Response Issue Pin
prabhakar dwivedi1-Oct-09 3:16
prabhakar dwivedi1-Oct-09 3:16 
AnswerRe: Web Service Response Issue Pin
Abhishek Sur1-Oct-09 4:52
professionalAbhishek Sur1-Oct-09 4:52 

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.