delphi发送邮件(附件+内嵌资源)源码分析
来源:互联网 发布:湖南传奇网络 编辑:程序博客网 时间:2024/06/14 00:53
1.无附件
with TIdText.Create(IdMessage1.MessageParts, nil) do begin
Body.Text := 'plain text goes here';
ContentType := 'text/plain';
end;
with TIdText.Create(IdMessage1.MessageParts, nil) do begin
Body.Text := 'HTML goes here';
ContentType := 'text/html';
end;
IdMessage1.ContentType := 'multipart/alternative';
2.只有附件
with TIdText.Create(IdMessage1.MessageParts, nil) do begin
ContentType := 'multipart/alternative';
end;
with TIdText.Create(IdMessage1.MessageParts, nil) do begin
Body.Text := 'plain textgoes here';
ContentType := 'text/plain';
ParentPart := 0;
end;
with TIdText.Create(IdMessage1.MessageParts, nil) do begin
Body.Text := 'HTML goes here';
ContentType := 'text/html';
ParentPart := 0;
end;
with TIdAttachmentFile.Create(IdMessage1.MessageParts, 'c:\folder\archive.zip') do begin
ContentType := 'application/x-zip-compressed';
FileName := 'archive.zip';
end;
IdMessage1.ContentType := 'multipart/mixed';
3.只有内嵌资源
with TIdText.Create(IdMessage1.MessageParts, nil) do begin
ContentType := 'multipart/alternative';
end;
with TIdText.Create(IdMessage1.MessageParts, nil) do begin
Body.Text := 'plain textgoes here';
ContentType := 'text/plain';
ParentPart := 0;
end;
with TIdText.Create(IdMessage1.MessageParts, nil) do begin
Body.Text := 'HTML goes here';
ContentType := 'text/html';
ParentPart := 0;
end;
with TIdAttachmentFile.Create(IdMessage1.MessageParts, 'c:\folder\image1.jpg') do begin
ContentID := '12345';
ContentType := 'image/jpeg';
FileName := 'image1.jpg';
end;
with TIdAttachmentFile.Create(IdMessage1.MessageParts, 'c:\folder\image2.jpg') do begin
ContentID := '56789';
ContentType := 'image/jpeg';
FileName := 'image2.jpg';
end;
IdMessage1.ContentType := 'multipart/related; type="multipart/alternative"';
4.内嵌资源附件都有
with TIdText.Create(IdMessage1.MessageParts, nil) do begin
ContentType := 'multipart/related; type="multipart/alternative"';
end;
with TIdText.Create(IdMessage1.MessageParts, nil) do begin
ContentType := 'multipart/alternative';
ParentPart := 0;
end;
with TIdText.Create(IdMessage1.MessageParts, nil) do begin
Body.Text := 'plain textgoes here';
ContentType := 'text/plain';
ParentPart := 1;
end;
with TIdText.Create(IdMessage1.MessageParts, nil) do begin
Body.Text := 'HTML goes here';
ContentType := 'text/html';
ParentPart := 1;
end;
with TIdAttachmentFile.Create(IdMessage1.MessageParts, 'c:\folder\image1.jpg') do begin
ContentID := '12345';
ContentType := 'image/jpeg';
FileName := 'image1.jpg';
ParentPart := 0;
end;
with TIdAttachmentFile.Create(IdMessage1.MessageParts, 'c:\folder\image2.jpg') do begin
ContentID := '56789';
ContentType := 'image/jpeg';
FileName := 'image2.jpg';
ParentPart := 0;
end;
with TIdAttachmentFile.Create(IdMessage1.MessageParts, 'c:\folder\archive.zip') do begin
ContentType := 'application/x-zip-compressed';
FileName := 'archive.zip';
end;
IdMessage1.ContentType := 'multipart/mixed';
- delphi发送邮件(附件+内嵌资源)源码分析
- JavaMail发送邮件和附件(源码)
- JavaMail发送邮件和附件(源码)
- JavaMail发送邮件和附件(源码)
- Spring实现邮件发送之添加附件、内嵌图片
- Spring 发送邮件 内嵌图片增加附件
- JavaMail发送邮件和附件(源码)_1
- JavaMail发送邮件和附件(源码)_2
- JavaMail发送邮件和附件(源码)_3
- JavaMail发送邮件和附件(源码)_4
- JavaMail发送邮件和附件(源码)_5
- JAVA邮件发送(文字+图片+附件)【源码】
- javamail 发送邮件,发复杂html,包括附件,以及内嵌图片的邮件
- Java Mail简化邮件发送+附件发送(源码奉上)
- spring邮件发送,正文附件发送的源码
- Delphi用Indy10实现smtp发送邮件支持附件
- Spring 发送带有内嵌图片和附件的邮件的java程序
- java实现发送邮件可多个附件内嵌图片-commons-email使用
- C++ 类的定义
- VirtualBox cannot ping Windows7 (host), Ubuntu (guest)
- 实体与值对象
- 初来乍到
- Android之AIDL(进程间通信)
- delphi发送邮件(附件+内嵌资源)源码分析
- jdbcl连接oracle数据库
- 小数点后面输出格式区别
- TStringList 的使用方法详解
- C++技能百炼之——运动员排序问题
- 信令
- delphi7+indy9发送邮件源码(测试通过)
- 信道
- vc中debug版程序正常但release版崩溃