Hola estoy tratando de enviar un mail desde IOS con Firemonkey y no logro hacerlo. Uso la siguiente rutina:
Código:
{$IFDEF IOS}
var NSU: NSUrl;
lURLnew:string;
begin
lURLnew := url;
if (xSubject<>'') or (xbody<>'') then
begin
lURLnew := lURLnew+'?subject='+xSubject;
if xbody<>'' then
lURLnew := lURLnew+'&body='+ xbody;
lURLnew := StringReplace(lURLnew,' ','%20',[rfReplaceAll]); //replace spaces
lURLnew := StringReplace(lURLnew,sLineBreak,'%0D%0A',[rfReplaceAll]);//replace linebreaks
end;
NSU := StrToNSUrl(TIdURI.URLEncode(lURLnew));
if SharedApplication.canOpenURL(NSU) then
exit(SharedApplication.openUrl(NSU))
else
begin
if DisplayError then
ShowMessage('Error: Opening "' + URL + '" not supported.');
exit(false);
end;
end;
{$ELSE}
begin
raise Exception.Create('Not supported!');
end;
{$ENDIF IOS}
Pero al ejecutarlo me da el siguiente error:
"Protocol field is empty"
Tendran la forma de hacerlo correctamente?
Gracias