uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, ComObj, StdCtrls; //+ComObj
var
Form1: TForm1;
jmail:Variant; //+
try
jmail:=CreateOleObject('jmail.message');
jmail.Silent := true;
jmail.Charset := 'gb2312'; // 邮件的文字编码为国标
jMail.ContentType := 'text/html';
jmail.From := ‘’;
jmail.FromName := '‘;
jmail.Subject := 'ninghaidata';
jmail.AddRecipient(‘’);
jmail.Body := 'sdafsdf';
jmail.MailServerUserName := '';
jmail.MailServerPassWord := '';
try
jmail.Send('smtp.163.com');
except
Exit;
end;
finally
jmail.Close;
end;