smtp1.Username:='22222'; smtp1.Password :='2222'; smtp1.Host:='smtp.163.com'; smtp1.Port :=25; smtp1.AuthenticationType:=atlogin; try smtp1.connect(1000); except showmessage('连接SMTP服务器失败!'); exit; end;try with msg do begin body.Clear; body.Assign(memo1.Lines); from.Address:=self.Edit1.Text ;
for i:=0 to self.ListBox1.Items.Count-1 do begin recipients.EMailAddresses:=self.ListBox1.Items.Strings[i];//这样群发的代码对不对的,我发一个邮件是可以的,两个以上就错了????????? end; end; smtp1.Send(msg); finally showmessage('你的邮件已成功发送'); smtp1.Disconnect;
smtp1.Username:='22222';
smtp1.Password :='2222';
smtp1.Host:='smtp.163.com';
smtp1.Port :=25;
smtp1.AuthenticationType:=atlogin;
try
smtp1.connect(1000);
except
showmessage('连接SMTP服务器失败!');
exit;
end;try
with msg do
begin
body.Clear;
body.Assign(memo1.Lines);
from.Address:=self.Edit1.Text ;
for i:=0 to self.ListBox1.Items.Count-1 do
begin recipients.EMailAddresses:=self.ListBox1.Items.Strings[i];//这样群发的代码对不对的,我发一个邮件是可以的,两个以上就错了????????? end;
end;
smtp1.Send(msg);
finally
showmessage('你的邮件已成功发送');
smtp1.Disconnect;