Hi
I am sending an email through the my form. It works on my home pc but it doesn't pick up on another pc. I have know clue why.
try
{
SmtpClient client = new SmtpClient("smtp.gmail.com", 587);
MailMessage message = new MailMessage();
message.From = new MailAddress(txtEmailAddress.Text);
message.To.Add(txtSendto.Text);
message.Body = image + head + subHeading + textBox1.Text + spaces + numericUpDown1.Text + spaces + numericUpDown2.Text + spaces + numericUpDown3.Text + fanta + creamSoda + sprite + appletiser + justJuice + grapetiser + chinesejuice + newLine + content;
message.Subject = txtSubject.Text;
message.IsBodyHtml = true;
client.UseDefaultCredentials = false;
client.EnableSsl = true;
client.Credentials = new System.Net.NetworkCredential(txtEmailAddress.Text,txtPassword.Text);
client.Send(message);
message = null;
MessageBox.Show("Message sent!");
}
catch(Exception ex)
{
MessageBox.Show("Failed to send message");
}
}
I am sending an email through the my form. It works on my home pc but it doesn't pick up on another pc. I have know clue why.
try
{
SmtpClient client = new SmtpClient("smtp.gmail.com", 587);
MailMessage message = new MailMessage();
message.From = new MailAddress(txtEmailAddress.Text);
message.To.Add(txtSendto.Text);
message.Body = image + head + subHeading + textBox1.Text + spaces + numericUpDown1.Text + spaces + numericUpDown2.Text + spaces + numericUpDown3.Text + fanta + creamSoda + sprite + appletiser + justJuice + grapetiser + chinesejuice + newLine + content;
message.Subject = txtSubject.Text;
message.IsBodyHtml = true;
client.UseDefaultCredentials = false;
client.EnableSsl = true;
client.Credentials = new System.Net.NetworkCredential(txtEmailAddress.Text,txtPassword.Text);
client.Send(message);
message = null;
MessageBox.Show("Message sent!");
}
catch(Exception ex)
{
MessageBox.Show("Failed to send message");
}
}