Updating from ProSocks 0.1 to 0.5 and the new attachment features of the SMTP function is giving me trouble. Since 0.5 doesn't use an include anymore, modifying the simba file is no longer an option. The test code I'm using:
Code:
{$loadlib prosocks}
var
S: SSLSocket;
begin
S.Init();
S.SetVerbose(True);
S.SMTP('smtp.gmail.com', 'sender@gmail.com', 'password', 'sender', 'receipt@hotmail.com', nil, nil, 'Subject', 'Message', nil, nil, 0);
S.Free();
end.
I'm only looking to send a simple email without any attachments or cc/bcc addresses. Completely removing those sections gives compile errors in the form of
Code:
Error: No default value for parameter 12 found at line 10
and setting the unneeded fields to nil produces errors like
Code:
Error: Expected variable of type "^AnsiChar", got "AnsiString" at line 10
or
Code:
Error: Expected variable of type "AnsiString", got "record [0]UInt32; [4]^AnsiChar; [8]^AnsiChar; [12]^AnsiChar; [16]function(<AnsiString>):UInt32; [20]function(^AnsiChar,Int32):UInt32; [24]function(^AnsiChar,UInt32,UInt32,<AnsiString>):UInt32; [28]function(^AnsiChar,UInt32,UInt32,<AnsiString>):UInt32; [32]^AnsiChar; [36]UInt32; [40]UInt16; [42](False=0, True=1); end" at line 8
I also understand that there is a difference between PChar and strings and that ProSocks expects PChars for all its fields. For how simple the example code in the ProSocks thread is, I feel like having to convert every string into a PChar is over-complicating things?
Is there something I'm overlooking?