X
xhr
Unregistered / Unconfirmed
GUEST, unregistred user!
procedure TForm1.BitBtn1Click(Sender: TObject);
var
my_message:TIdMessage;
begin
try
IdSMTP1.Connect();
except
showmessage('连接邮件服务器失败!');
exit;
end;
//开始发送
try
my_message:=TIdMessage.Create(application);
try
my_message.Body.Add('发送邮件,哈哈');
my_message.Headers.Add('发送邮件');
my_message.Subject:='发送邮件';
my_message.From.Address:='xinhuirong@163.com';
my_message.From.Name:='发送邮件';
my_message.From.Text:='xinhuirong@163.com';
my_message.Recipients.EMailAddresses:='xinhuirong@163.com';
IdSMTP1.SendMsg(my_message);
except
showmessage('send fail!');
exit;
end;
finally
my_message.Free;
end;
showmessage('send success!');
end;
程序运行提示"'send success",但打开邮箱并没有到收到邮件,不知是代码哪里有问题!!
host:smtp.163.com
var
my_message:TIdMessage;
begin
try
IdSMTP1.Connect();
except
showmessage('连接邮件服务器失败!');
exit;
end;
//开始发送
try
my_message:=TIdMessage.Create(application);
try
my_message.Body.Add('发送邮件,哈哈');
my_message.Headers.Add('发送邮件');
my_message.Subject:='发送邮件';
my_message.From.Address:='xinhuirong@163.com';
my_message.From.Name:='发送邮件';
my_message.From.Text:='xinhuirong@163.com';
my_message.Recipients.EMailAddresses:='xinhuirong@163.com';
IdSMTP1.SendMsg(my_message);
except
showmessage('send fail!');
exit;
end;
finally
my_message.Free;
end;
showmessage('send success!');
end;
程序运行提示"'send success",但打开邮箱并没有到收到邮件,不知是代码哪里有问题!!
host:smtp.163.com