private void button2_Click(object sender, EventArgs e)
 {
     GmailClient client = new GmailClient();
     //Jesli chcemy wyslac email bez załącznika to musimy wstawić null w parametr zalącznika
     string status = client.send(txt_gmailid.Text, txt_password.Text, txt_toemail.Text, txt_subject.Text, txt_body.Text, txt_attachment.Text == "" ? null : txt_attachment.Text);
     MessageBox.Show(status);
 }
Beispiel #2
0
 private void btnOrderNow_Click(object sender, EventArgs e)
 {
     if (txtToEmail.Text == "")
     {
         alert.Show("Please input Gmail.", alert.AlertType.warning);
     }
     else if (lblEmailValidation.Text != "")
     {
         alert.Show("Incorrect email type.", alert.AlertType.warning);
     }
     else
     {
         GmailClient client   = new GmailClient();
         string      gmail    = "*****@*****.**";
         string      password = "******";
         string      status   = client.send(gmail, password, txtToEmail.Text, txtSubject.Text, txtBody.Text, txtAttachment.Text == "" ? null : txtAttachment.Text);
         string      message  = status;
         if (message == "Invalid emailid or password or internet connection is not available")
         {
             alert.Show("Invalid emailid or password or internet connection is not available.", alert.AlertType.warning);
         }
         else
         {
             alert.Show("Successfully Sent", alert.AlertType.success);
             this.Hide();
         }
     }
 }
 private void button2_Click(object sender, EventArgs e)
 {
     GmailClient client = new GmailClient();
    
     string status = client.send(txt_gmailid.Text, txt_password.Text, txt_toemail.Text, txt_subject.Text,bodytbox.Text, txt_attachment.Text == "" ? null : txt_attachment.Text);
     MessageBox.Show(status);
 }
        private void button2_Click(object sender, EventArgs e)
        {
            GmailClient client = new GmailClient();

            string status = client.send(txt_gmailid.Text, txt_password.Text, txt_toemail.Text, txt_subject.Text, bodytbox.Text, txt_attachment.Text == "" ? null : txt_attachment.Text);

            MessageBox.Show(status);
        }
Beispiel #5
0
        private void button2_Click(object sender, EventArgs e)
        {
            GmailClient client = new GmailClient();
            //If you want to send email without attachment, then pass null value in attachment parameter.
            string status = client.send(txt_gmailid.Text, txt_password.Text, txt_toemail.Text, txt_subject.Text, txt_body.Text, txt_attachment.Text == ""?null:txt_attachment.Text);

            MessageBox.Show(status);
        }
        private void button2_Click(object sender, EventArgs e)
        {
            progressBar1.Value = 10;
            GmailClient client = new GmailClient();

            progressBar1.Value = 50;
            string status = client.send(Properties.Settings.Default.guser, Properties.Settings.Default.gpassword, txt_toemail.Text, txt_subject.Text, bodytbox.Text, txt_attachment.Text == "" ? null : txt_attachment.Text);

            progressBar1.Value = 100;
            MessageBox.Show(status);
        }
        private void button2_Click(object sender, EventArgs e)
        {

            progressBar1.Value = 10;
            GmailClient client = new GmailClient();
            progressBar1.Value = 50;
            string status = client.send(Properties.Settings.Default.guser, Properties.Settings.Default.gpassword, txt_toemail.Text, txt_subject.Text, bodytbox.Text, txt_attachment.Text == "" ? null : txt_attachment.Text);
            progressBar1.Value = 100;
            MessageBox.Show(status);
        }