Welcome![Sign In][Sign Up]
Location:
Search - jpg delphi

Search list

[Delphi VCL带附件及Html显示的邮件发送类

Description:

unit UnitSendMail;

interface

uses
  Windows, SysUtils, Classes,StdCtrls, ExtCtrls, ComCtrls, Dialogs,
  IdMessage, IdBaseComponent, IdComponent, IdTCPConnection, IdTCPClient,
  IdExplicitTLSClientServerBase,IdMessageClient, IdSMTPBase, IdSMTP, IdText,
  IDAttachmentFile;

function SendEMail(SenderName, SenderAddress: PChar;
    Receivename, ReceiveAddress: PChar; MailSubject, MailContent: PChar;
    JpgFileName: PChar; SendType: Integer; PicID: PChar; IsCustom: Boolean;Attachment:PChar): Boolean; stdcall;
function ConnectMailServer(Host, UserName, Password: PChar;
    Port: Integer): Boolean; stdcall;
procedure DisconnectMail; stdcall;

type
  TSendMailObj = class
  private
    FHost: String;
    FPort: Integer;
    FUserName: String;
    FPassword: String;
    ASmtp: TIdSMTP;
  public
    property Host: string read FHost write FHost;
    property Port: Integer read FPort write FPort;
    property UserName: String read FUserName write FUserName;
    property Password: String read FPassword write FPassword;
    constructor Create;
    function ConnectServer: Boolean;
    function SendEMail(SenderName, SenderAddress: PChar;
      Receivename, ReceiveAddress: PChar; MailSubject, MailContent: PChar;
      JpgFileName: PChar; SendType: Integer; PicID: PChar;
      IsCustom: Boolean;Attachment:PChar): Boolean;
  end;

var
  SendObj: TSendMailObj;

implementation

function SendEMail(SenderName, SenderAddress: PChar;
    Receivename, ReceiveAddress: PChar; MailSubject, MailContent: PChar;
    JpgFileName: PChar; SendType: Integer; PicID: PChar; IsCustom: Boolean;Attachment:PChar): Boolean; stdcall;
begin
  Result :=  SendObj.SendEMail(SenderName, SenderAddress, Receivename,
          ReceiveAddress, MailSubject, MailContent,
            JpgFileName, SendType, PicID, IsCustom,Attachment);
end;

function ConnectMailServer(Host, UserName, Password: PChar;
    Port: Integer): Boolean; stdcall;
begin
  try
    //if SendObj = nil then
    SendObj := TSendMailObj.Create;
{    if SendObj.ASmtp.Connected then
      SendObj.ASmtp.Disconnect;  }
    SendObj.Host := StrPas(Host);
    SendObj.Port := Port;
    SendObj.Username := StrPas(UserName);
    SendObj.Password := StrPas(Password);
    Result := SendObj.ConnectServer;
  except
    Result := False;
  end;
end;

procedure DisconnectMail; stdcall;
begin
  if SendObj <> nil then
  begin
    if SendObj.ASmtp <> nil then
      SendObj.ASmtp.Disconnect;
    SendObj := nil;
    SendObj.Free;
  end;
end;
{ TSendMailObj }

function TSendMailObj.ConnectServer: Boolean;
begin
  ASmtp.Host := FHost;
  ASmtp.Port := FPort;
  ASmtp.Username := FUserName;
  ASmtp.Password := FPassword;
  try
    ASmtp.Connect;
    Result := ASmtp.Connected;
  except
    Result := False;
  end;
end;

constructor TSendMailObj.Create;
begin
  ASmtp := TIdSMTP.Create(nil);

end;

function TSendMailObj.SendEMail(SenderName, SenderAddress, Receivename,
  ReceiveAddress, MailSubject, MailContent, JpgFileName: PChar;
  SendType: Integer; PicID: PChar; IsCustom: Boolean;Attachment:PChar): Boolean;
var
  IdBody, IdHtml: TIdText;
  Att: TIdAttachmentFile;
  AMessage: TIdMessage;
  ASmtp_1: TIdSMTP;
begin
  ASmtp_1 := TIdSMTP.Create(nil);
  ASmtp_1.Host := FHost;
  ASmtp_1.Port := FPort;
  ASmtp_1.Username := FUserName;
  ASmtp_1.Password := FPassword;
  //ASmtp_1.AuthType := atDefault;
  ASmtp_1.Connect; // }
  if not ASmtp.Connected then
    ASmtp.Connect;
  AMessage := TIdMessage.Create(nil);
  with AMessage do
  begin
    NoDecode := False;
    NoEncode := False;
    ContentType := 'multipart/mixed';
    Encoding := meMIME;
    MsgId := 'PrettyPic';
    if FileExists(StrPas(JpgFileName)) then
      References := ChangeFileExt(ExtractFileName(StrPas(JpgFileName)), '')
    else
      References := '';
    Recipients.Clear;
    with Recipients.Add do
    begin
      Name := StrPas(Receivename);
      Address := StrPas(ReceiveAddress);
    end;
    Subject := StrPas(MailSubject);
    Sender.Name := StrPas(SenderName);
    Sender.Address := StrPas(SenderAddress);
    From.Name := Sender.Name;
    From.Address := Sender.Address;
    if SendType = 0 then
    begin
      IdBody := TIdText.Create(MessageParts);
      IdBody.ContentType := 'text/plain';
      IdBody.Body.Add(StrPas(MailContent));
      IdBody.Body.Add('');
    end
    else
    begin
      IdHtml := TIdText.Create(MessageParts);
      IdHtml.ContentType := 'text/html;charset=gb2312';
      IdHtml.ContentTransfer := '7bit';
      IdHtml.Body.Add(' <html>');
      IdHtml.Body.Add('  <head>');
      IdHtml.Body.Add('      <title>' + StrPas(MailSubject) + ' </title>');
      IdHtml.Body.Add('  </head>');
      IdHtml.Body.Add('  <body title="' + References + '">');
      IdHtml.Body.Add('    ' + StrPas(MailContent) + ' <br>');
      if (not IsCustom) and FileExists(StrPas(JpgFileName)) then
        IdHtml.Body.Add('      <img src="cid:' + StrPas(PicID) + '" alt="' + ExtractFileName(StrPas(JpgFileName)) +
                            '" name="' + ExtractFileName(StrPas(JpgFileName)) + '" title="">');
      IdHtml.Body.Add('  </body>');
      IdHtml.Body.Add(' </html>');
    end;
    if FileExists(StrPas(JpgFileName)) then
    begin
      Att := TIdAttachmentFile.Create(MessageParts, StrPas(JpgFileName));
      Att.ExtraHeaders.Values['Content-ID'] := StrPas(PicID);
      Att.ContentType := 'image/jpg';
    end;  
    if FileExists(StrPas(Attachment)) then
    begin
      Att := TIdAttachmentFile.Create(MessageParts, StrPas(Attachment));
    end;
  end;
  try
    ASmtp_1.Send(AMessage);
    if Att <> nil then
      Att.Free;
    if IdBody <> nil then
      IdBody.Free;
    if IdHtml <> nil then
      IdHtml.Free;
    if AMessage <> nil then
      AMessage.Free;
    ASmtp_1.Disconnect;

    ASmtp_1.Free; //}
    ASmtp.Disconnect;
    Result := True;
  except on e: Exception do
  begin
    Result := False;
  end;
  end;

end;

end.


Platform: | Size: 1685 | Author: kennyxue | Hits:

[Windows Developsnag

Description: 抓图Snag 我用Delphi6写的一个基本的抓图程序。具有基本的抓图功能,如截屏、任意区域截取、热键抓图、保存为bmp或者jpg.内含原码 -Delphi6 Snag I used to write a basic screen in the process. Previously with basic features, such as screen shots, arbitrary regional interception, hotkey Previously, the depositary for the bmp jpg or. Intron- source
Platform: | Size: 493568 | Author: 杨红 | Hits:

[Graph programTakePhoto 缩略图制作工具 V1.0

Description: TakePhoto 缩略图制作工具 V1.0 关键字:TakePhoto 缩略图 JPG GIF 图像 制作工具 来 自:原创 深浅度:中级 发布时间:2004-11-26 分 类:图形 发布者:dynamicdigital 更新时间:2004-11-26 语 种:简体中文 编辑器:DELPHI7 平  台:Win9x,Win2k/XP/NT,Win2003 浏 览:952 作品源代码: 本地电信HTTP下载 软件或演示: - 代码大小: 475.4K 软件大小: - 广州天弟数码摄像头 在线打长途座机只要1毛8 文字广告招商¥100/月 文字广告招商¥100/月 这是我昨晚熬夜的成果,支持JPG和GIF格式。 1、分单张处理和整个目录处理。 2、单张处理时,可以定制生成缩略图的大小(程序限制了150*150,可以自己修改),可以截取任意大小的一部分图像来生成缩略图。 3、整个目录处理时,选取该目录下的其中一幅图片,定制好生成大小。 由于熬夜太累,程序中存在问题是在所难免了,希望有心的朋友加以改进。-TakePhoto thumbnail tool V1.0 keyword : TakePhoto JPG GIF thumbnail images from the production tools : originality DEPTH :-release : 2004-2006-11-26 Category : Graphic release : dynamicdigital updated : 2004-2006-11-26 languages : SR body of Chinese Editors : DELPHI7 platforms : Win9x, Win2k/XP/NT, Win2003 here : 952 works of the source code : HTTP local telecommunications software or download demo :-code size : 475.4K software Size :-Guangzhou Tian-di-line digital camera as long as the long-distance plane a hair eight characters Accordingly 100/text ads on investment 100/month which I stay up late last night results, JPG and GIF format. 1, sub-processing and pamphlets dealing with the whole directory. 2, leaflets processing, can customize the generated thumbnail size (procedural res
Platform: | Size: 486400 | Author: 李和 | Hits:

[OtherImageUtils

Description: delphi BMP转JPG的d-JPG the d
Platform: | Size: 102400 | Author: 文化 | Hits:

[Picture Viewer728 MJpg 缩略图 批量处理 图形

Description: 1 生成指定图片的缩略图 2 批量生成某一目录内所有图片缩略图 3 提供5种缩略图尺寸定义模式 4 目前只支持.jpg格式-designated a generation of thumbnail pictures generated a two-volume directory of all three thumbnail pictures for five thumbnail size definition model currently supports only four. Jpg format
Platform: | Size: 646144 | Author: 邢封 | Hits:

[Picture Viewer多功能图像浏览器

Description: 一款多功能图像浏览器,可以浏览目前大多数常用格式的图像:jpg、bmp、tiff、gif等-versatile image browser, can browse most of the common image format : jpg, bmp, tiff, gif, etc.
Platform: | Size: 311296 | Author: 王杰 | Hits:

[2D Graphic1.4 图像的格式 转换

Description: 图象格式的转换软件,可以在bmp、ico、jpg、wmp、emf之间的相互转换,delphi编写!-image format conversion software in bmp, ico, jpg, :, Corel between the conversion, delphi prepared!
Platform: | Size: 304128 | Author: setiya | Hits:

[Compress-Decompress algrithmsjpeglib1

Description: 含有七个函数,读写Jpeg,GIFBMP。可自动识别JPGGIFBMP;可保存JPG;可控制JPG的读写速度、质量;可读取动画GIF的任意帧;标准参数调用,可用于其他程序语言;占极少的内存!(修正了1.0版中的BUG)-containing seven functions, read and write Jpeg, GIFBMP. Automatic identification JPGGIFBMP; Kept JPG; JPG control the read and write speed, quality; GIF animation can be read arbitrary frame; standard parameters call, to be used in other programming languages; for minimal memory! (Amended version 1.0 of Bug)
Platform: | Size: 171008 | Author: 王子秋 | Hits:

[OtherJPG2BMP

Description: 图片格式中JPG格式与BMP格式的互相转换-Photo JPG format and the format of BMP format interchangeable
Platform: | Size: 608256 | Author: Freely | Hits:

[GDI-BitmapGraphicEx

Description: 一个可以打开多种格式图片的插件,如:jpg,mepg-can open up a variety of plug-in format pictures, such as : jpg, mepg
Platform: | Size: 444416 | Author: | Hits:

[OtherVC_jpeglib

Description: 利用Delphi的代码在VC中显示JPG图片,不使用动态连接库-using Delphi code in VC show JPG picture, the non-use of Dynamic Link Library
Platform: | Size: 105472 | Author: | Hits:

[Special EffectsWebSaveToJPG

Description: 可以把整个网页保存成JPG图片。做了改进-can keep the entire page into JPG picture. Made improvements
Platform: | Size: 700416 | Author: 林文轩 | Hits:

[Delphi VCLgdiplus

Description: Borland没有提供对Gdiplus的支持,有了这个类库,Delphi就可以使用Gdiplus了。 Gdiplus 是微软对GDI的扩充,可以方便的读取如png、jpg的格式的图像文件,并提供了较为丰富的二位矢量图形的绘制接口。-Borland does not provide support for gdiplus, With this library, Delphi can use the gdiplus. Gdiplus is the Microsoft GDI expansion can be easily read, such as png, jpg format image files, and provide a relatively rich 2 vector graphics rendering interface.
Platform: | Size: 1170432 | Author: 张良 | Hits:

[ADO-ODBCImageData

Description: 数据库存储图片,可以将图片存入access数据库,也可以读出另存为,支持BMP,JPG等-Database storage picture, you can access the database into the picture, you can read out the Save As, support BMP, JPG, etc.
Platform: | Size: 1183744 | Author: Clubs | Hits:

[Picture Viewerpic_save

Description: 图片批量保存器 可以把图片批量的原样保存到mdb数据库中,然后随意查看。 支持bmp,jpg,gif等等。没有压缩功能。-Photo bulk can save the bulk of the original picture is saved to mdb database, and then arbitrarily Show. Support for bmp, jpg, gif, etc.. Without compression.
Platform: | Size: 18432 | Author: 齐欢乐 | Hits:

[Picture Viewerjpg

Description: 自己写的一个图片管理小程序 JPG,BMP.... 缩放等简单编辑什么的 现学现用,希望给大家启发-Write their own picture of a small program management JPG, BMP .... zoom, such as what is simple to edit the current study, hoping to inspire everyone
Platform: | Size: 550912 | Author: 林冲 | Hits:

[Picture Viewerbmptojpg

Description: JPG与BMP图片文件格式变换,软件使用简单方便.-JPG and BMP picture file format conversion, the software is simple and convenient to use.
Platform: | Size: 4257792 | Author: 李锋 | Hits:

[Delphi VCLjpgjiami

Description: jpg文件加密.rar 加密jpg文件 的源码 可以让您的照片加上一个保护密码-jpg file encryption. rar jpg file encryption source code can make your photos with a password protection
Platform: | Size: 245760 | Author: xc | Hits:

[Compress-Decompress algrithmsdelphi

Description: 图片文件压缩,用delphi实现jpg图片压缩-Image file compression, using jpg delphi image compression
Platform: | Size: 209920 | Author: qdgp | Hits:

[Delphi VCLDELPHI存取JPEG、BMP图像到数据库

Description: DELPHI存取JPG\BMP等图像文件到数据库(DELPHI access JPG\BMP and other image files to the database)
Platform: | Size: 769024 | Author: allenalone | Hits:
« 12 3 4 5 6 7 8 »

CodeBus www.codebus.net