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

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:

[GDI-Bitmap生成缩略图

Description: delphi7.0,按照设定的分辨率生成缩略图,不需要任何第三方控件
Platform: | Size: 6218 | Author: xmsonghy | 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:

[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 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:

[DirextXleida232_radardemo11

Description: 窄波束雷达用delphi做的directshow视频捕 (.\photo\date\*.JPG). 当测速仪发现目标时,测速仪以下列格式发送关于目标的信息:驶近的目标进入探测区域的时刻发送0xFC字节。驶近的目标离开探测区域时测速仪发送数据包: 0xFA字节 – Spd – Len。Spd – 速度值 ТС, Len – 车辆长度.-Narrow-beam radar used delphi do DirectShow video capture (. Photodate*. JPG). When the gun to find a target, gun to the following format to send information on the goals: the goal of approaching the moment of entering the detection region sent word 0xFC section. Approaching the goal of leaving the detection region velocimetry data packets sent: 0xFA bytes- Spd- Len. Spd- speed value ТС, Len- the length of the vehicle.
Platform: | Size: 1107968 | Author: LIUBOSS | Hits:

[Algorithmencode-64

Description: 使用DELPHI实现的 base64 加解密的算法代码,速度较快-DELPHI achieved using base64 algorithm for encryption and decryption code, faster
Platform: | Size: 169984 | Author: lxmh815 | Hits:

[Otherchinamap

Description: 全国各省mapinfo格式和jpg格式电子地图,注意版权问题。-Provinces mapinfo format and jpg format, electronic map and pay attention to copyright issues.
Platform: | Size: 29050880 | Author: 杨东昆 | Hits:

[Video Capturejpgavi

Description: Delphi制作的图片合成视频小例子已经文档说明-Delphi composite video image produced by a small example has been documented
Platform: | Size: 371712 | Author: 彼岸 | Hits:

[Delphi VCLBASE64

Description: Delphi JPG 图片的 BASE64 编码、解码(BASE64 encoding and decoding of Delphi JPG pictures)
Platform: | Size: 892928 | Author: 特色噶 | 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