Comment below marked FIX shows where empty string is changed to use the appropriate Setting value.
The line here in HttpUpload is the one I've modified:
Code: Select all
with TWinHttp.Create(httpUrl, ssl, port, false, '', '', userName, password, proxyServer, proxyBypass, proxyUserName, proxyPassword, stngs, pa) do begin
Code: Select all
function HttpUpload(const httpUrl : AnsiString;
ssl : boolean;
port : dword;
const userName : UnicodeString;
const password : UnicodeString;
const attachments : IMEAttachments;
const fields : IMEFields = nil;
const mailFrom : UnicodeString = '';
parentWindow : HWND = 0;
hidden : boolean = false;
background : boolean = false;
const settings : IMESettings = nil ) : boolean;
var attachFiles : TDAUnicodeString;
attachSendAs, attachFields : TDAUnicodeString;
pa : IProgressAlert;
stngs : IMESettings;
begin
if settings <> nil then
stngs := settings
else
stngs := {$ifdef xe2} MESettings(ReturnAddress); {$else} MESettingsEx(1); {$endif}
attachSendAs := nil;
attachFields := nil;
pa := PrepareAttachments(stngs, attachments, attachFiles, attachSendAs, attachFields, parentwindow, hidden, background);
with TWinHttp.Create(httpUrl, ssl, port, false,
{FIX: why hard code an empty string? }stngs.HttpAccount,
{FIX: why hard code an empty string? }stngs.HttpPassword,
userName,
password,
proxyServer, proxyBypass, proxyUserName, proxyPassword, stngs, pa) do begin
result := Post(mailFrom, fields, attachFiles, attachSendAs, attachFields);
Free;
end;
end;