|
[x]
Posted via EE Mobile
|
|
| Search, ask, and monitor your questions on the go with EE Mobile. Visit Experts Exchange from your mobile device and never be out of touch again. |
|
|
|
|
Asked by beyuslu in Internet and Delphi Programming
hi;
I want multiple email send. i can 1 mail send per second with my delphi programme. but when i try another mail sender, i can 700 mail send per minute. I wrote their own codes follow. how i can send faster email?
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
|
function SendReport(ServerName, FromEmail, FriendlyName, ToEmail, Subject, Info: string): Boolean;
var
htmpart, txtpart: TIdText;
Email: TIdMessage;
html: TStrings;
IdSMTP: TIdSMTP;
begin
Email := TIdMessage.Create(nil);
html := TStringList.Create();
IdSMTP := TIdSMTP.Create(nil);
HTML.Add(Info);
IdSMTP.Host := ServerName;
email.ReplyTo.EMailAddresses := FromEmail;
email.From.Text := FriendlyName;
email.Recipients.EMailAddresses := ToEmail;
email.Subject := Subject;
email.ContentType := 'multipart/mixed';
email.Body.Assign(html);
txtpart := TIdText.Create(email.MessageParts, html);
txtpart.ContentType := 'text/plain';
txtpart.Body.Text := 'This is a html email';
htmpart := TIdText.Create(email.MessageParts, html);
htmpart.ContentType := 'text/html';
{ Now send it }
try
idSMTP.Connect();
try
idSMTP.Send(email);
except on E: Exception do
begin
result := false;
end;
end;
finally
idSMTP.Disconnect();
end;
html.Free();
htmpart.Free;
txtpart.Free;
Email.Free;
IdSMTP.Free;
end;
|
20091111-EE-VQP-89 - Hierarchy / EE_QW_3_20080625