curl4delphi icon indicating copy to clipboard operation
curl4delphi copied to clipboard

Mimetype issues

Open jbfsoftware opened this issue 5 years ago • 0 comments

Hi, I have been using your library happily to use curl with delphi. I ran into a few issues when using SMTP and attachments.

  1. Function curl_mime_type. Your function requires a HCurlMime argument, but the curl function seems to need a HCurlMimeType argument.
  2. For curl_easy_setopt I could not use a TCurlMimeOption. (CURLOPT_MIMEPOST). I needed to add an overloaded version of the function curl_easy_setopt.

Running a diff on your latest source of Curl.Lib.pas and my adjusted version I get this:

1760c1760
< function curl_mime_type(part : HCurlMime; mimetype : PAnsiChar) : TCurlCode;
---
> function curl_mime_type(part : HCurlMimePart; mimetype : PAnsiChar) : TCurlCode;
2616a2616,2620
> function curl_easy_setopt(
>         curl : HCurl;
> 		option : TCurlMimeOption;
> 		data : HCurlMime) : TCurlCode;  overload; inline;
> 
3062a3067,3074
> function curl_easy_setopt(
>         curl : HCurl;
> 		option : TCurlMimeOption;
> 		data : HCurlMime) : TCurlCode;
> begin
>   Result := curl_easy_setopt_initial(curl, option, NativeUInt(data));
>   end;
> 

I wanted to let you know, it seems a good improvement to me to include this into your original. Greetings, JP.

jbfsoftware avatar Jul 18 '20 22:07 jbfsoftware