SHARE
TWEET

Untitled

a guest Apr 21st, 2018 205 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. sing System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Web;
  5. using System.Web.UI;
  6. using System.Web.UI.WebControls;
  7. using System.Net.Mail;
  8. using System.Net;
  9.  
  10. public partial class Form : System.Web.UI.Page
  11. {
  12.     protected void Page_Load(object sender, EventArgs e)
  13.     {
  14.  
  15.     }
  16.     protected void EmailButton_Click(object sender, EventArgs e)
  17.     {
  18.         string txtFrom = "gard9070@gmail.com";
  19.         string txtTo = "PartyHardStreetTeam@gmail.com";
  20.         string txtSubject = NameTextBox.Text + " Quote Request";
  21.         string txtBody = "Name: " + NameTextBox.Text +
  22.                          "/nPhone Number: " + PhoneTextBox.Text +
  23.                          "/nEvent Type: " + EventRadioButtonList.SelectedValue.ToString() +
  24.                          "/nDate of Event: " + Calendar1.SelectedDate.ToShortDateString() +
  25.                          "/nDJ Required: " + DJRadioButtonList.SelectedValue.ToString() +
  26.                          "/nLiquor Required: " + LiquorRadioButtonList.SelectedValue.ToString() +
  27.                          "/nLiquor Package: " + PackagesRadioButtonList.SelectedValue.ToString() +
  28.                          "/nSongs Required: " + SongTextBox.Text;
  29.         MailMessage mailObj = new MailMessage();
  30.         var client = new SmtpClient("smtp.gmail.com, 465")
  31.             {
  32.                 Credentials = new NetworkCredential("Gard9070@gmail.com", "*****"),//*** is password
  33.                 EnableSsl = true
  34.             };
  35.         client.Send(txtFrom, txtTo, txtSubject, txtBody);
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top