Results 1 to 3 of 3

Thread: ProSocks 0.5 SMTP - ignoring parameter requirements

  1. #1
    Join Date
    Jan 2012
    Posts
    85
    Mentioned
    0 Post(s)
    Quoted
    40 Post(s)

    Default ProSocks 0.5 SMTP - ignoring parameter requirements

    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?

  2. #2
    Join Date
    Feb 2011
    Location
    The Future.
    Posts
    5,600
    Mentioned
    396 Post(s)
    Quoted
    1598 Post(s)

    Default

    Fixed:

    https://github.com/Brandon-T/ProSocks/releases/tag/v0.6

    Simba Code:
    {$loadlib prosocks}

    var
      S: SSLSocket;

    begin
      S.Init();
      S.SetVerbose(True);
      S.SetSecurityPolicy(false, false, true);
      S.SMTP('smtps://smtp.gmail.com', 'email@gmail.com', 'password', 'SenderName', 'recipient@gmail.com', '', '', 'Subject', 'Message', '', '', '');
      S.Free();
    end.


    P.S. Your URL is wrong. It's missing the protocol.
    Last edited by Brandon; 08-19-2016 at 12:51 AM.
    I am Ggzz..
    Hackintosher

  3. #3
    Join Date
    Jan 2012
    Posts
    85
    Mentioned
    0 Post(s)
    Quoted
    40 Post(s)

    Default

    Quote Originally Posted by Brandon View Post
    Fixed:

    Excellent! Everything compiles now. Thank you for the speedy push.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •