帮助电子邮件发件人一些错误 [英] help in email sender some errors
本文介绍了帮助电子邮件发件人一些错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在使用c#处理电子邮件应用程序并且电子邮件没有收到代码
iam working on an e mail application using c# and the email doesn,t receive the code
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.Net.Mail;
using System.Net;
namespace webclient
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void textBox1_TextChanged(object sender, EventArgs e)
{
}
private void Form1_Load(object sender, EventArgs e)
{
}
private void button1_Click(object sender, EventArgs e)
{
MailMessage message = new MailMessage();
message.From = new MailAddress(textBox4.Text);
message.Subject = textBox2.Text;
message.Body = textBox3.Text;
foreach (string s in textBox1.Text.Split(';'))
message.To.Add(s);
SmtpClient client = new SmtpClient();
client.Credentials = new NetworkCredential(textBox4.Text, textBox5.Text);
client.Host = "smtp.gmail.com";
client.Port = 587;
client.EnableSsl = true;
client.Send(message);
}
private void groupBox1_Enter(object sender, EventArgs e)
{
}
private void pictureBox1_Click(object sender, EventArgs e)
{
}
private void textBox1_TextChanged_1(object sender, EventArgs e)
{
}
private void button1_Click_1(object sender, EventArgs e)
{
}
}
}
推荐答案
smtp。 gmail.com现在需要谷歌的认证,请看这里的帖子: http://how2doinvbdotnet.blogspot.ae/2015/06/send-email-from-gmail-with-smtp.html?view=timeslide [ ^ ]
smtp.gmail.com now requires a authetication from google please see post here : http://how2doinvbdotnet.blogspot.ae/2015/06/send-email-from-gmail-with-smtp.html?view=timeslide[^]
这篇关于帮助电子邮件发件人一些错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文