คำถามติดแท็ก system.net.mail

2
MailMessage ความแตกต่างระหว่างคุณสมบัติของ Sender และ From
ฉันใช้System.Netเนมสเปซมาตลอดตั้งแต่เราเปลี่ยนจาก. NET Framework 1.1 เป็น 3.5 framework แต่มีสิ่งหนึ่งที่ทำให้ฉันงงตั้งแต่นั้นมา อะไรคือความแตกต่างระหว่างคุณสมบัติSenderและFromคุณสมบัติในMailMessageคลาส? ทั้งคู่เหมือนกันไหมและถ้าไม่มีจะใช้Senderร่วมกันด้วยFrom? ตัวอย่างเช่น: Using m As New System.Net.Mail.MailMessage() m.Sender = New System.Net.Mail.MailAddress("test@test.com", "Name here") m.From = New System.Net.Mail.MailAddress("test@test.com", "Name here") m.Subject = "Test" m.Body = "Test" Dim client As New System.Net.Mail.SmtpClient("mymailserver.com") client.Send(m) End Using
โดยการใช้ไซต์ของเรา หมายความว่าคุณได้อ่านและทำความเข้าใจนโยบายคุกกี้และนโยบายความเป็นส่วนตัวของเราแล้ว
Licensed under cc by-sa 3.0 with attribution required.