IDMessage+IdSMTP 撰寫系統自動發出Infomail... 正常Run一段時間後... 會發出沒有內文的郵件!? |
尚未結案
|
yching
一般會員 發表:6 回覆:22 積分:10 註冊:2007-03-23 發送簡訊給我 |
我用 IDMessage+IdSMTP 撰寫系統自動發出Infomail 的procedure 供其他procedure 需要時呼叫運用...
程式設定Timer 正常Run一段時間後(幾天不一定)... 會發出沒有內文的郵件!?(其他資料都有,就差郵件沒內文) 必須再關閉重開程式才會正常。是否有大大遇過相同的問題呢?亦或有大大知道怎麼處理嗎? ps. 我確定我傳入的tBody 是有內容的! [code delphi] procedure TForm1.SendInfoMail(tRecipients, tFrom, tSubject, tBody, tAttach: string); Var Attach : TIdAttachment; begin try IDMessage.From.Name := tFrom; IDMessage.From.Address := tFrom; IDMessage.Subject := tSubject; IDMessage.Body.Text := tBody; if Trim(tAttach)<>'' then Attach:=Tidattachment.create(IDMessage.MessageParts, TFileName(tAttach)); IDMessage.Recipients.EMailAddresses := tRecipients MsgIdSMTP.connect; MsgIdSMTP.Send(IdMessage); MsgIdSMTP.Disconnect; except on xErr: Exception do begin if MsgIdSMTP.connected then try MsgIdSMTP.disconnect; except end; MessageDlg('Info mail send Failed !!!', mtError, [mbOk], 0); end; end; IDMessage.Recipients.EMailAddresses := ''; IDMessage.CCList.EMailAddresses := ''; IDMessage.BCCList.EMailAddresses := ''; if Assigned(Attach) then Attach.Free; // 釋放Create附加檔案 end; [/code] 編輯記錄
yching 重新編輯於 2008-10-16 10:18:41, 註解 無‧
|
RaynorPao
版主 發表:139 回覆:3622 積分:7025 註冊:2002-08-12 發送簡訊給我 |
|
yching
一般會員 發表:6 回覆:22 積分:10 註冊:2007-03-23 發送簡訊給我 |
本站聲明 |
1. 本論壇為無營利行為之開放平台,所有文章都是由網友自行張貼,如牽涉到法律糾紛一切與本站無關。 2. 假如網友發表之內容涉及侵權,而損及您的利益,請立即通知版主刪除。 3. 請勿批評中華民國元首及政府或批評各政黨,是藍是綠本站無權干涉,但這裡不是政治性論壇! |