想做一个发送EMail的程序,要内置SMTP服务器,如何做? 想做一个发送EMail的程序,要内置SMTP服务器,如何做? 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 SMTP服务,关键应该在于MX记录及其相应Mail域名解析,邮件暂存及转发,除此之外就是一项普通的网络服务。 利用outlook Outlook := CreateOLEObject('Outlook.Application'); if VarIsEmpty(Outlook) then begin MessageBox(handle, 'Outlook ¦Û°Ê¤Æ¹ï¶H³Ð«Ø¥¢±Ñ¡I', nil, 0); Exit; end; OutlookNameSpace :=Outlook.GetNamespace('MAPI'); OutlookFolder:=OutlookNameSpace.GetDefaultFolder(3); myDistList :=OutlookFolder.Items; Mail := Outlook.CreateItem(olMailItem); //olMailItem=1 cipient:=Mail.Recipients.Add('[email protected]'); cipient.Type:=olTo; Mail.Body := ''; Mail.Send; Outlook := Unassigned; Mail := Unassigned; 如果要內置SMTP服務器的話,用TIDSMTP,IDmsgSend控件做, with IdMsgSend do begin body.Clear; body.Add(bodyText); From.Text := Frommail; Recipients.EMailAddresses := Usermail; { To: header } Subject := subjectText; { Subject: header } ReceiptRecipient.Text := '';// TIdAttachment.Create(IdMsgSend.MessageParts, bodytext1); end; SMTP.AuthenticationType := atLogin; SMTP.Username := 'dreamy'; SMTP.Password := '1111'; {General setup} SMTP.Host := '????';//你的郵件服務器地址; SMTP.Host :=mailip; SMTP.Port := 25; {now we send the message} SMTP.Connect; try try SMTP.Send(IdMsgSend); result := True; except result := False; end; finally SMTP.Disconnect; end; 正则表达式匹配问题 imageEN 安装方法 求助~!~!不盛感激~!~ delphi程序实现远程访问数据库 散分,BS发贴不结贴的`~~ 关于Delphi操作Excel的两个问题。有兴趣的朋友进来探讨一下。(实在没办法了) 请大家谈谈D7和D8的区别??小弟想学Delphi,但不知学哪个版本好?请各位介绍一下!!! 来考考大家!娱乐一下 如何判断挡前的操作系统? ehlib中如何放combobox,DBComboBox fr3.15报表在预览是提示 Source File not found 'fs_iilparser.pas' 将多个图片插入画图程序并打开
Outlook := CreateOLEObject('Outlook.Application');
if VarIsEmpty(Outlook) then
begin
MessageBox(handle, 'Outlook ¦Û°Ê¤Æ¹ï¶H³Ð«Ø¥¢±Ñ¡I', nil, 0);
Exit;
end; OutlookNameSpace :=Outlook.GetNamespace('MAPI');
OutlookFolder:=OutlookNameSpace.GetDefaultFolder(3);
myDistList :=OutlookFolder.Items;
Mail := Outlook.CreateItem(olMailItem); //olMailItem=1
cipient:=Mail.Recipients.Add('[email protected]');
cipient.Type:=olTo;
Mail.Body := '';
Mail.Send;
Outlook := Unassigned;
Mail := Unassigned;
with IdMsgSend do
begin
body.Clear;
body.Add(bodyText);
From.Text := Frommail;
Recipients.EMailAddresses := Usermail; { To: header }
Subject := subjectText; { Subject: header }
ReceiptRecipient.Text := '';
// TIdAttachment.Create(IdMsgSend.MessageParts, bodytext1);
end;
SMTP.AuthenticationType := atLogin;
SMTP.Username := 'dreamy';
SMTP.Password := '1111'; {General setup}
SMTP.Host := '????';//你的郵件服務器地址;
SMTP.Host :=mailip;
SMTP.Port := 25; {now we send the message}
SMTP.Connect;
try
try
SMTP.Send(IdMsgSend);
result := True;
except
result := False;
end;
finally
SMTP.Disconnect;
end;