Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- sing System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Web;
- using System.Web.UI;
- using System.Web.UI.WebControls;
- using System.Net.Mail;
- using System.Net;
- public partial class Form : System.Web.UI.Page
- {
- protected void Page_Load(object sender, EventArgs e)
- {
- }
- protected void EmailButton_Click(object sender, EventArgs e)
- {
- string txtFrom = "gard9070@gmail.com";
- string txtTo = "PartyHardStreetTeam@gmail.com";
- string txtSubject = NameTextBox.Text + " Quote Request";
- string txtBody = "Name: " + NameTextBox.Text +
- "/nPhone Number: " + PhoneTextBox.Text +
- "/nEvent Type: " + EventRadioButtonList.SelectedValue.ToString() +
- "/nDate of Event: " + Calendar1.SelectedDate.ToShortDateString() +
- "/nDJ Required: " + DJRadioButtonList.SelectedValue.ToString() +
- "/nLiquor Required: " + LiquorRadioButtonList.SelectedValue.ToString() +
- "/nLiquor Package: " + PackagesRadioButtonList.SelectedValue.ToString() +
- "/nSongs Required: " + SongTextBox.Text;
- MailMessage mailObj = new MailMessage();
- var client = new SmtpClient("smtp.gmail.com, 465")
- {
- Credentials = new NetworkCredential("Gard9070@gmail.com", "*****"),//*** is password
- EnableSsl = true
- };
- client.Send(txtFrom, txtTo, txtSubject, txtBody);
Add Comment
Please, Sign In to add comment