IdMessage主旨長度超過46會出現異常狀況 |
尚未結案
|
peterpcc
一般會員 發表:6 回覆:37 積分:13 註冊:2004-09-27 發送簡訊給我 |
|
allenchan
資深會員 發表:10 回覆:306 積分:283 註冊:2004-01-06 發送簡訊給我 |
|
peterpcc
一般會員 發表:6 回覆:37 積分:13 註冊:2004-09-27 發送簡訊給我 |
with IdMessage1 do begin From.Address:=DRLabel13.Caption; From.Name:=tToken(DRLabel13.Caption,'@',1); Recipients.EMailAddresses := v_recipients; CCList.EMailAddresses := ''; {CC} BccList.EMailAddresses := ''; {BBC} Subject := v_Subject; { Subject: header } Subject :=Base64Decode(v_Subject); // 1 IdMessage1.MessageParts.Clear; Tidtext.Create(IdMessage1.MessageParts); with Tidtext.Create(IdMessage1.MessageParts,v_Strings) do ContentType:='text/plain'; for i:=0 to listbox1.Count-1 do TIdAttachment.Create(IdMessage1.MessageParts, Listbox1.Items[i]) end;//我想可能是我判斷處錯了,因為我追蹤時,發現Base64Decode函數並未執行到. while pos('=?big5?b?',lowercase(strInput)) > 0 do // 這段沒執行到 begin try posStart := pos('=?big5?b?',lowercase(strInput)); posEnd := pos('?=',lowercase(strInput)); strDecode := strDecode copy(strInput,1,posStart-1) IdDecoderMIME1.DecodeString(copy(strInput,posStart 9,posEnd-posStart-9)); strInput := copy(strInput,posEnd 2,length(strInput)-posEnd-1); finally Application.ProcessMessages; end; end; strDecode := strDecode strInput; result := strDecode; |
allenchan
資深會員 發表:10 回覆:306 積分:283 註冊:2004-01-06 發送簡訊給我 |
其實不太懂您的描述,Base64Decode 是一個您自己撰寫的 Function?
內容為:
while pos('=?big5?b?',lowercase(strInput)) > 0 do // 這段沒執行到 begin try posStart := pos('=?big5?b?',lowercase(strInput)); posEnd := pos('?=',lowercase(strInput)); strDecode := strDecode copy(strInput,1,posStart-1) IdDecoderMIME1.DecodeString(copy(strInput,posStart 9,posEnd-posStart-9)); strInput := copy(strInput,posEnd 2,length(strInput)-posEnd-1); finally Application.ProcessMessages; end; end; strDecode := strDecode strInput; result := strDecode; end;當你呼叫 Base64Decode 時,他執行到 while pos('=?big5?b?',lowercase(strInput)) > 0 do 結果條件不成立嗎?還是有啥狀況?所謂的沒執行到是? |
peterpcc
一般會員 發表:6 回覆:37 積分:13 註冊:2004-09-27 發送簡訊給我 |
function TForm1.Base64Decode(strInput : string) : string; var strDecode : string; posStart: Integer; posEnd : Integer; while pos('=?big5?b?',lowercase(strInput)) > 0 do // 這段沒執行到 begin try posStart := pos('=?big5?b?',lowercase(strInput)); posEnd := pos('?=',lowercase(strInput)); strDecode := strDecode copy(strInput,1,posStart-1) IdDecoderMIME1.DecodeString(copy(strInput,posStart 9,posEnd-posStart-9)); strInput := copy(strInput,posEnd 2,length(strInput)-posEnd-1); finally Application.ProcessMessages; end; end; strDecode := strDecode strInput; result := strDecode; end;這是取自這兒高手的內容,我的意思是while那段的條件沒成立過,追蹤時看到代入的都是文字串,並沒有=?big5?b?'這些字在. 所以我就弄不清楚,到底應該在哪時候去做這Base64Decode的動作? |
allenchan
資深會員 發表:10 回覆:306 積分:283 註冊:2004-01-06 發送簡訊給我 |
|
peterpcc
一般會員 發表:6 回覆:37 積分:13 註冊:2004-09-27 發送簡訊給我 |
|
allenchan
資深會員 發表:10 回覆:306 積分:283 註冊:2004-01-06 發送簡訊給我 |
|
peterpcc
一般會員 發表:6 回覆:37 積分:13 註冊:2004-09-27 發送簡訊給我 |
|
peterpcc
一般會員 發表:6 回覆:37 積分:13 註冊:2004-09-27 發送簡訊給我 |
|
Blueberrug
一般會員 發表:14 回覆:50 積分:17 註冊:2005-05-22 發送簡訊給我 |
|
Ktop_Robot
站務副站長 發表:0 回覆:3511 積分:0 註冊:2007-04-17 發送簡訊給我 |
本站聲明 |
1. 本論壇為無營利行為之開放平台,所有文章都是由網友自行張貼,如牽涉到法律糾紛一切與本站無關。 2. 假如網友發表之內容涉及侵權,而損及您的利益,請立即通知版主刪除。 3. 請勿批評中華民國元首及政府或批評各政黨,是藍是綠本站無權干涉,但這裡不是政治性論壇! |