主题:关于发送邮件
这段代码有什么问题????为什么邮件发不出去,我25端口是开放的,
procedure TForm1.FlatButton1Click(Sender: TObject);
begin
smtp.Host:=edit6.text;
smtp.Username:=edit1.text;
smtp.Password:=edit3.Text;
smtp.Port:=25;
mailmessage.From.Address:=edit1.text;
mailmessage.Recipients.EMailAddresses:=edit2.Text;
mailmessage.Subject:=edit4.text;
mailmessage.Body.Assign(memo1.Lines );
try
try
begin
smtp.Connect(10000);
smtp.Send(mailmessage);
end;
except
end;
finally
if smtp.Connected then
smtp.Disconnect;
end;
end;
procedure TForm1.FlatButton1Click(Sender: TObject);
begin
smtp.Host:=edit6.text;
smtp.Username:=edit1.text;
smtp.Password:=edit3.Text;
smtp.Port:=25;
mailmessage.From.Address:=edit1.text;
mailmessage.Recipients.EMailAddresses:=edit2.Text;
mailmessage.Subject:=edit4.text;
mailmessage.Body.Assign(memo1.Lines );
try
try
begin
smtp.Connect(10000);
smtp.Send(mailmessage);
end;
except
end;
finally
if smtp.Connected then
smtp.Disconnect;
end;
end;