I want to send a textBox value in email in C#. some one Help me?
I want to send a textBox 开发者_运维技巧value in email in C#. some one Help me?
see Scott Gu's article to send Sending Email with System.Net.Mail here.
Load the body of the mail with the TextBox.Text value
txtBox.Text;
will give you the value in C#
TextBox.Text Property
you can try something like this
MailMessage msg = new MailMessage();
msg.From = "test@mail.com";
msg.To.Add("rec@mail.com");
msg.Subject = "test";
msg.Body = yourTextbox.Text
SmtpClient smtpClient = new SmtpClient();
smtpClient.Host = _smtpHostName; //host name
smtpClient.Port = _smtpPort; //required port
smtpClient.Send(msg);
Have a look at
SmtpClient Class
and SmtpClient Constructor (String, Int32)
精彩评论