就是使用NMSMTP和POP3
一个是简单邮件传输协议
一个是邮局协议3
下面的是SMTP(简单邮件传输协议)用于发送邮件,很简单同样
POP3也很简单,
DELPHI中的DEMONS下的FASTNET目录下有例子,
详细情况自己看吧。
begin
NMSMTP1.Port := 25;
NMSMTP1.Host := SaveFileContent.TSmtpServer;
NMSMTP1.PostMessage.ToAddress := ANewMail.SMailAddress;
NMSMTP1.PostMessage.FromAddress := SaveFileContent.TEmailAddress;
NMSMTP1.PostMessage.Subject := ANewMail.SMailSubject;
NMSMTP1.PostMessage.Body.Assign(ANewMail.SContent);
NMSMTP1.PostMessage.FromName := SaveFileContent.UserName;
NMSMTP1.PostMessage.ReplyTo := SaveFileContent.TEmailAddress;
NMSMTP1.PostMessage.ToCarbonCopy := SplitMailAddress(Edit2.Text);
try
NMSMTP1.Connect;
NMSMTP1.SendMail;
MessageDlg('ÓʼþÒѳɹ¦·¢ËÍ!', mtConfirmation, [mbOK], 0);
finally
NMSMTP1.Disconnect;
end;