Насколько я знаю, не существует кроссплатформенного способа отправки почты, но с помощью функции ShellExecute
в Windows и NSWorkspace.openURL для OSX вы можете написать свой собственный. реализация.
Попробуйте эту реализацию OSX.
uses
Macapi.Foundation,
Macapi.AppKit,
System.SysUtils;
Procedure SendMail(const Mailto,Subject, Body:string);
var
URL : NSURL;
AWorkspace : NSWorkspace;
encodedSubject,
encodedTo,
encodedBody : NSString;
begin
//NSString *encodedSubject = [NSString stringWithFormat:@"SUBJECT=%@", [subject stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]];
encodedSubject :=NSSTR(Format('SUBJECT=',[Subject])).stringByAddingPercentEscapesUsingEncoding(NSUTF8StringEncoding);
//NSString *encodedBody = [NSString stringWithFormat:@"BODY=%@", [body stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]];
encodedBody :=NSSTR(Format('BODY=',[Body])).stringByAddingPercentEscapesUsingEncoding(NSUTF8StringEncoding);
//NSString *encodedTo = [to stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
encodedTo :=NSSTR(Mailto).stringByAddingPercentEscapesUsingEncoding(NSUTF8StringEncoding);
//NSString *encodedURLString = [NSString stringWithFormat:@"mailto:%@?%@&%@", encodedTo, encodedSubject, encodedBody];
//NSURL *mailtoURL = [NSURL URLWithString:encodedURLString];
// [[NSWorkspace sharedWorkspace] openURL:mailtoURL];
URL := TNSURL.Create;
URL.initWithString(NSSTR(Format('mailto:%s?%s&%s',[ encodedTo.UTF8String, encodedSubject.UTF8String, encodedBody.UTF8String])));
AWorkspace := TNSWorkspace.Create;
AWorkspace.openURL(URL);
end;