1,593
社区成员
发帖
与我相关
我的任务
分享
IdSMTP1.Host:=Trim(edt1.text);
IdSMTP1.Port:=StrToInt(Trim(edt2.text));
IdSMTP1.Username:=Trim(edt3.text);
IdSMTP1.Password:=Trim(edt4.text);
idmsg1.Priority:=mpHigh;
idmsg1.From.Address := Trim(edt3.text);
idmsg1.Recipients.EMailAddresses := Trim(edt6.text);
idmsg1.CharSet:='GB2312';
idmsg1.ContentType := 'text/html; charset="GB2312"';
idmsg1.From.Name:='张三';
idmsg1.Subject:=Trim(edt5.text);
idmsg1.Body.Add('<html>');
idmsg1.Body.Add('<head>');
idmsg1.Body.Add('<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=gb2312">');
idmsg1.Body.Add('<title>'+idmsg1.Subject+'</title>');
idmsg1.Body.Add('</head>');
idmsg1.Body.Add('<body>');
for I := 0 to mmo1.Lines.Count-1 do
begin
idmsg1.Body.Add(mmo1.Lines.Strings[i]+'<br>');
end;
idmsg1.Body.Add('</body>');
idmsg1.Body.Add('</html>');
try
try
IdSMTP1.Connect();
IdSMTP1.Authenticate;
if IdSMTP1.Connected then
begin
IdSMTP1.Send(idmsg1);
ShowMessage('发送成功');
end;
except
on e:Exception do
begin
ShowMessage('Error:' + e.Message);
IdSMTP1.Disconnect;
Exit;
end;
end;
finally
IdSMTP1.Disconnect;
end;
图牧脸色难看,惊异地望着金摩的虚影,心中有些发寒。
http://bbs.csdn.net
金摩不是实体,像是传说中的鬼魂,这一类反常的事物,让图牧这种骁勇善战的佣兵都有些发毛,这才退了一步,<font color="#CC0000">想要看看情况再说。</font>
他一退步,石岩立即看出了他发虚,准确的把握住了时机,猎豹一样提着匕首疾冲出去,并且招呼迪雅兰一起动手。
迪雅兰虽然也是有些害怕,但是因为知道那鬼影是被石岩释放出来,这才提着胆子从背后围攻图牧。
sList:TStringList
将邮件内容先添加到sList ,然后运行#4的代码,再运行#5发送邮件! idmsg1.MessageParts.Clear;
with TIdText.Create(idmsg1.MessageParts, sList) do
begin
ContentType := 'text/html';
CharSet := 'UTF-8'
end;
idsmtp2.Send(idmsg1);
idmsg1.Encoding := meMIME;