<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
<title></title>
</head>
<body bgcolor="#ffffff" text="#000000">
btw, I was scrolling through the list<br>
did you ever sort out your Indy 10 mailing problem?<br>
(you mentioned it back in March, so here's hoping....)<br>
I know how to fix your current Indy version if you are
unable/(hitting walls) to upgrade it<br>
<br>
David<br>
<br>
<br>
On 13/07/2011 9:42 a.m., David O'Brien wrote:
<blockquote
cite="mid:45218D834A0CE743BA57A2A8521AFC2706F0D4@iccs-server.ICCS.local"
type="cite">
<meta http-equiv="Content-Type" content="text/html;
charset=ISO-8859-1">
<meta name="Generator" content="Microsoft Word 14 (filtered
medium)">
<style><!--
/* Font Definitions */
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
@font-face
        {font-family:Consolas;
        panose-1:2 11 6 9 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri","sans-serif";
        color:black;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
pre
        {mso-style-priority:99;
        mso-style-link:"HTML Preformatted Char";
        margin:0cm;
        margin-bottom:.0001pt;
        font-size:10.0pt;
        font-family:"Courier New";
        color:black;}
p.MsoAcetate, li.MsoAcetate, div.MsoAcetate
        {mso-style-priority:99;
        mso-style-link:"Balloon Text Char";
        margin:0cm;
        margin-bottom:.0001pt;
        font-size:8.0pt;
        font-family:"Tahoma","sans-serif";
        color:black;}
span.EmailStyle17
        {mso-style-type:personal;
        font-family:"Calibri","sans-serif";
        color:windowtext;}
span.EmailStyle18
        {mso-style-type:personal;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
span.HTMLPreformattedChar
        {mso-style-name:"HTML Preformatted Char";
        mso-style-priority:99;
        mso-style-link:"HTML Preformatted";
        font-family:"Consolas","serif";
        color:black;}
span.EmailStyle21
        {mso-style-type:personal-reply;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
span.BalloonTextChar
        {mso-style-name:"Balloon Text Char";
        mso-style-priority:99;
        mso-style-link:"Balloon Text";
        font-family:"Tahoma","sans-serif";
        color:black;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:72.0pt 72.0pt 72.0pt 72.0pt;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
<div class="WordSection1">
<p class="MsoNormal"><span style="color: rgb(31, 73, 125);">I
think from memory that was to do with the SMTP component
being already connected to another server. Must have been a
good reason at the time...<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color: rgb(31, 73, 125);"><o:p> </o:p></span></p>
<div>
<div style="border-right: medium none; border-width: 1pt
medium medium; border-style: solid none none; border-color:
rgb(181, 196, 223) -moz-use-text-color -moz-use-text-color;
padding: 3pt 0cm 0cm;">
<p class="MsoNormal"><b><span style="font-size: 10pt;
font-family:
"Tahoma","sans-serif"; color:
windowtext;" lang="EN-US">From:</span></b><span
style="font-size: 10pt; font-family:
"Tahoma","sans-serif"; color:
windowtext;" lang="EN-US"> <a class="moz-txt-link-abbreviated" href="mailto:delphi-bounces@delphi.org.nz">delphi-bounces@delphi.org.nz</a>
[<a class="moz-txt-link-freetext" href="mailto:delphi-bounces@delphi.org.nz">mailto:delphi-bounces@delphi.org.nz</a>] <b>On Behalf Of </b>David<br>
<b>Sent:</b> Tuesday, 12 July 2011 8:26 p.m.<br>
<b>To:</b> <a class="moz-txt-link-abbreviated" href="mailto:delphi@delphi.org.nz">delphi@delphi.org.nz</a><br>
<b>Subject:</b> Re: [DUG] Email/SMTP code<o:p></o:p></span></p>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal" style="margin-bottom: 12pt;">Erm...<br>
I understand your code works, but you probably want to remove
this bit. <br>
The RFC doesn't require a pause<o:p></o:p></p>
<p class="MsoNormal" style=""><span style="color: rgb(31, 73,
125);"> t := now ;</span><o:p></o:p></p>
<p class="MsoNormal" style=""><span style="color: rgb(31, 73,
125);"> while (SMTP.Connected) and</span><o:p></o:p></p>
<p class="MsoNormal" style=""><span style="color: rgb(31, 73,
125);"> (now < t + 10 * (1/86400)) do // 10
Seconds</span><o:p></o:p></p>
<p class="MsoNormal"><span style="color: rgb(31, 73, 125);">
sleep(10) ;<br>
<br>
</span>Also, to get around the mailservers that block you (
e.g. when they don't know you, or think you're a spam bot)<br>
just relay the message through your own ISP<br>
e.g. if you're with orcon, use mail.orcon.net.nz, if you're
with ihug, use their smtp server...<br>
As long as you have the correct destination email addresses
(and aren't in fact writing a spam bot), the big mail servers
can do the work for you<br>
<br>
David<br>
<br>
On 12/07/2011 2:01 p.m., David O'Brien wrote: <o:p></o:p></p>
<p class="MsoNormal"><span style="color: rgb(31, 73, 125);">Wrote
this a while ago, but still works...</span><o:p></o:p></p>
<p class="MsoNormal"><span style="color: rgb(31, 73, 125);"> </span><o:p></o:p></p>
<p class="MsoNormal"><span style="color: rgb(31, 73, 125);">procedure
SendEmail(msgFrom, msgTo, msgSubject: String; msgBody:
TStringList; Attachments: TStringList) ;</span><o:p></o:p></p>
<p class="MsoNormal"><span style="color: rgb(31, 73, 125);">var</span><o:p></o:p></p>
<p class="MsoNormal"><span style="color: rgb(31, 73, 125);">
IdMessage: TIdMessage;</span><o:p></o:p></p>
<p class="MsoNormal"><span style="color: rgb(31, 73, 125);">
SMTP: TIdSMTP;</span><o:p></o:p></p>
<p class="MsoNormal"><span style="color: rgb(31, 73, 125);"> t:
TDateTime ;</span><o:p></o:p></p>
<p class="MsoNormal"><span style="color: rgb(31, 73, 125);"> i:
Integer ;</span><o:p></o:p></p>
<p class="MsoNormal"><span style="color: rgb(31, 73, 125);">begin</span><o:p></o:p></p>
<p class="MsoNormal"><span style="color: rgb(31, 73, 125);">
try</span><o:p></o:p></p>
<p class="MsoNormal"><span style="color: rgb(31, 73, 125);">
if ASettings.SMTPServer <> '' then</span><o:p></o:p></p>
<p class="MsoNormal"><span style="color: rgb(31, 73, 125);">
begin</span><o:p></o:p></p>
<p class="MsoNormal"><span style="color: rgb(31, 73, 125);">
SMTP := TidSMTP.Create(nil) ;</span><o:p></o:p></p>
<p class="MsoNormal"><span style="color: rgb(31, 73, 125);">
IdMessage := TIdMessage.Create(SMTP);</span><o:p></o:p></p>
<p class="MsoNormal"><span style="color: rgb(31, 73, 125);">
try</span><o:p></o:p></p>
<p class="MsoNormal"><span style="color: rgb(31, 73, 125);">
idMessage.Clear ;</span><o:p></o:p></p>
<p class="MsoNormal"><span style="color: rgb(31, 73, 125);">
idMessage.From.Address := msgFrom ;</span><o:p></o:p></p>
<p class="MsoNormal"><span style="color: rgb(31, 73, 125);">
idMessage.Recipients.Add.Address := msgTo ;</span><o:p></o:p></p>
<p class="MsoNormal"><span style="color: rgb(31, 73, 125);">
idMessage.Subject := msgSubject ;</span><o:p></o:p></p>
<p class="MsoNormal"><span style="color: rgb(31, 73, 125);">
if pos('<html', lowercase(msgBody.Text)) <> 0 then</span><o:p></o:p></p>
<p class="MsoNormal"><span style="color: rgb(31, 73, 125);">
idMessage.ContentType := 'text/html' ;</span><o:p></o:p></p>
<p class="MsoNormal"><span style="color: rgb(31, 73, 125);">
if msgBody <> nil then</span><o:p></o:p></p>
<p class="MsoNormal"><span style="color: rgb(31, 73, 125);">
IdMessage.Body.Assign(msgBody) ;</span><o:p></o:p></p>
<p class="MsoNormal"><span style="color: rgb(31, 73, 125);">
t := now ;</span><o:p></o:p></p>
<p class="MsoNormal"><span style="color: rgb(31, 73, 125);">
while (SMTP.Connected) and</span><o:p></o:p></p>
<p class="MsoNormal"><span style="color: rgb(31, 73, 125);">
(now < t + 10 * (1/86400)) do // 10 Seconds</span><o:p></o:p></p>
<p class="MsoNormal"><span style="color: rgb(31, 73, 125);">
sleep(10) ;</span><o:p></o:p></p>
<p class="MsoNormal"><span style="color: rgb(31, 73, 125);">
if Assigned(Attachments) then</span><o:p></o:p></p>
<p class="MsoNormal"><span style="color: rgb(31, 73, 125);">
for i := 0 to pred(Attachments.Count) do</span><o:p></o:p></p>
<p class="MsoNormal"><span style="color: rgb(31, 73, 125);">
TIdAttachmentFile.Create(IdMessage.MessageParts,
Attachments[i]) ;</span><o:p></o:p></p>
<p class="MsoNormal"><span style="color: rgb(31, 73, 125);">
SMTP.Host := ASettings.SMTPServer ;</span><o:p></o:p></p>
<p class="MsoNormal"><span style="color: rgb(31, 73, 125);">
SMTP.Port := ASettings.SMTPPort ;</span><o:p></o:p></p>
<p class="MsoNormal"><span style="color: rgb(31, 73, 125);">
SMTP.Username := ASettings.Username ;</span><o:p></o:p></p>
<p class="MsoNormal"><span style="color: rgb(31, 73, 125);">
SMTP.Password := ASettings.Password ;</span><o:p></o:p></p>
<p class="MsoNormal"><span style="color: rgb(31, 73, 125);">
SMTP.Connect ;</span><o:p></o:p></p>
<p class="MsoNormal"><span style="color: rgb(31, 73, 125);">
try</span><o:p></o:p></p>
<p class="MsoNormal"><span style="color: rgb(31, 73, 125);">
SMTP.Send(idMessage) ;</span><o:p></o:p></p>
<p class="MsoNormal"><span style="color: rgb(31, 73, 125);">
finally</span><o:p></o:p></p>
<p class="MsoNormal"><span style="color: rgb(31, 73, 125);">
SMTP.Disconnect ;</span><o:p></o:p></p>
<p class="MsoNormal"><span style="color: rgb(31, 73, 125);">
end ;</span><o:p></o:p></p>
<p class="MsoNormal"><span style="color: rgb(31, 73, 125);">
finally</span><o:p></o:p></p>
<p class="MsoNormal"><span style="color: rgb(31, 73, 125);">
SMTP.Free ;</span><o:p></o:p></p>
<p class="MsoNormal"><span style="color: rgb(31, 73, 125);">
IdMessage.Free ;</span><o:p></o:p></p>
<p class="MsoNormal"><span style="color: rgb(31, 73, 125);">
end;</span><o:p></o:p></p>
<p class="MsoNormal"><span style="color: rgb(31, 73, 125);">
end;</span><o:p></o:p></p>
<p class="MsoNormal"><span style="color: rgb(31, 73, 125);">
except</span><o:p></o:p></p>
<p class="MsoNormal"><span style="color: rgb(31, 73, 125);">
EmailFailed := True ;</span><o:p></o:p></p>
<p class="MsoNormal"><span style="color: rgb(31, 73, 125);">
end ;</span><o:p></o:p></p>
<p class="MsoNormal"><span style="color: rgb(31, 73, 125);">end
;</span><o:p></o:p></p>
<p class="MsoNormal"><span style="color: rgb(31, 73, 125);"> </span><o:p></o:p></p>
<div>
<div style="border-right: medium none; border-width: 1pt
medium medium; border-style: solid none none; padding: 3pt
0cm 0cm; border-color: -moz-use-text-color;">
<p class="MsoNormal"><b><span style="font-size: 10pt;
font-family:
"Tahoma","sans-serif";"
lang="EN-US">From:</span></b><span style="font-size:
10pt; font-family:
"Tahoma","sans-serif";" lang="EN-US">
<a moz-do-not-send="true"
href="mailto:delphi-bounces@delphi.org.nz">delphi-bounces@delphi.org.nz</a>
[<a moz-do-not-send="true"
href="mailto:delphi-bounces@delphi.org.nz">mailto:delphi-bounces@delphi.org.nz</a>]
<b>On Behalf Of </b>John Bird<br>
<b>Sent:</b> Tuesday, 12 July 2011 1:47 p.m.<br>
<b>To:</b> NZ Borland Developers Group - Delphi List<br>
<b>Subject:</b> [DUG] Email/SMTP code</span><o:p></o:p></p>
</div>
</div>
<p class="MsoNormal"> <o:p></o:p></p>
<div>
<div>
<div>
<p class="MsoNormal"><span style="font-size: 10pt;
font-family:
"Arial","sans-serif";">Anyone got
a recommendation for the best (free) code/samples to
drive Indy10 for sending an email with attachment</span><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size: 10pt;
font-family:
"Arial","sans-serif";"> </span><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size: 10pt;
font-family:
"Arial","sans-serif";">-Indy10.2.3</span><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size: 10pt;
font-family:
"Arial","sans-serif";">-Send
attachment</span><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size: 10pt;
font-family:
"Arial","sans-serif";">-SMTP
server and email addresses will be known</span><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size: 10pt;
font-family:
"Arial","sans-serif";"> </span><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size: 10pt;
font-family:
"Arial","sans-serif";">I have
tried a couple (eg AtoZed SendMail example) but it
seems to time out connecting to the SMTP </span><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size: 10pt;
font-family:
"Arial","sans-serif";"> </span><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size: 10pt;
font-family:
"Arial","sans-serif";">John</span><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size: 10pt;
font-family:
"Arial","sans-serif";"> </span><o:p></o:p></p>
</div>
</div>
</div>
<p class="MsoNormal"><span style="font-size: 12pt; font-family:
"Times New Roman","serif";"><br>
<br>
__________ Information from ESET Smart Security, version of
virus signature database 6285 (20110711) __________<br>
<br>
The message was checked by ESET Smart Security.<br>
<br>
<a moz-do-not-send="true" href="http://www.eset.com">http://www.eset.com</a><br>
<br>
<o:p></o:p></span></p>
<pre><o:p> </o:p></pre>
<pre><o:p> </o:p></pre>
<pre>_______________________________________________<o:p></o:p></pre>
<pre>NZ Borland Developers Group - Delphi mailing list<o:p></o:p></pre>
<pre>Post: <a moz-do-not-send="true" href="mailto:delphi@delphi.org.nz">delphi@delphi.org.nz</a><o:p></o:p></pre>
<pre>Admin: <a moz-do-not-send="true" href="http://delphi.org.nz/mailman/listinfo/delphi">http://delphi.org.nz/mailman/listinfo/delphi</a><o:p></o:p></pre>
<pre>Unsubscribe: send an email to <a moz-do-not-send="true" href="mailto:delphi-request@delphi.org.nz">delphi-request@delphi.org.nz</a> with Subject: unsubscribe<o:p></o:p></pre>
<pre><o:p> </o:p></pre>
<pre><o:p> </o:p></pre>
<pre>__________ Information from ESET Smart Security, version of virus signature database 6285 (20110711) __________<o:p></o:p></pre>
<pre><o:p> </o:p></pre>
<pre>The message was checked by ESET Smart Security.<o:p></o:p></pre>
<pre><o:p> </o:p></pre>
<pre><a moz-do-not-send="true" href="http://www.eset.com">http://www.eset.com</a><o:p></o:p></pre>
<pre><o:p> </o:p></pre>
<p class="MsoNormal"><span style="font-size: 12pt; font-family:
"Times New Roman","serif";"><o:p> </o:p></span></p>
</div>
<br>
<br>
__________ Information from ESET Smart Security, version of virus
signature database 6288 (20110712) __________<br>
<br>
The message was checked by ESET Smart Security.<br>
<br>
<a moz-do-not-send="true" href="http://www.eset.com">http://www.eset.com</a><br>
<pre wrap="">
<fieldset class="mimeAttachmentHeader"></fieldset>
_______________________________________________
NZ Borland Developers Group - Delphi mailing list
Post: <a class="moz-txt-link-abbreviated" href="mailto:delphi@delphi.org.nz">delphi@delphi.org.nz</a>
Admin: <a class="moz-txt-link-freetext" href="http://delphi.org.nz/mailman/listinfo/delphi">http://delphi.org.nz/mailman/listinfo/delphi</a>
Unsubscribe: send an email to <a class="moz-txt-link-abbreviated" href="mailto:delphi-request@delphi.org.nz">delphi-request@delphi.org.nz</a> with Subject: unsubscribe
__________ Information from ESET Smart Security, version of virus signature database 6288 (20110712) __________
The message was checked by ESET Smart Security.
<a class="moz-txt-link-freetext" href="http://www.eset.com">http://www.eset.com</a>
</pre>
</blockquote>
<br>
</body>
</html>