Delphi 2010 寫郵件發送程式 |
尚未結案
|
g9221712
高階會員 發表:145 回覆:344 積分:162 註冊:2006-07-06 發送簡訊給我 |
請問各位前輩:
如下標示黃色的字體,在Delphi7使用都沒有問題,可是一轉到Delphi 2010 卻只能 使用// 這一行本來Delphi 7可以,但是到Delphi 2010就不行了 af := TIdAttachmentFile.Create(idMessage1.MessageParts, 'c:\test.txt'); // set up the SMTP component IdSMTP1.Host := 'myhost.mycompany.com'; IdSMTP1.MailAgent := 'My Mail'; IdSMTP1.UserName := 'felix'; IdSMTP1.HeloName := 'felix'; IdSMTP1.Password := 'my password'; IdSMTP1.Port := 25; IdMessage1.From.Text := 'Felix { the rest of the setup is done once the file (stFileName) has been created and the list of recipients (st) has been determined, called by a button click } IdMessage1.BccList.EmailAddresses := st; // list collected from a table af.FileName := stFileName; IdSMTP1.Connect; IdSMTP1.Send(IdMessage1); { wasn't crashing until it tried to attach the file, back when I was able to compile my project. I haven't changed any code since installing the latest indy tiburon } IdSMTP1.Disconnect;
------
「人們所以覺得寂寞,是因為他們會築牆,卻不會搭橋。」 程式寫的越久,卻發現自己越來越不會寫程式! |
firesu
中階會員 發表:26 回覆:28 積分:55 註冊:2004-12-27 發送簡訊給我 |
|
g9221712
高階會員 發表:145 回覆:344 積分:162 註冊:2006-07-06 發送簡訊給我 |
|
firesu
中階會員 發表:26 回覆:28 積分:55 註冊:2004-12-27 發送簡訊給我 |
本站聲明 |
1. 本論壇為無營利行為之開放平台,所有文章都是由網友自行張貼,如牽涉到法律糾紛一切與本站無關。 2. 假如網友發表之內容涉及侵權,而損及您的利益,請立即通知版主刪除。 3. 請勿批評中華民國元首及政府或批評各政黨,是藍是綠本站無權干涉,但這裡不是政治性論壇! |