Ver Mensaje Individual
  #1  
Antiguo 15-08-2018
DamianG DamianG is offline
Miembro
 
Registrado: mar 2008
Posts: 95
Reputación: 17
DamianG Va por buen camino
Enviar mail IOS Firemonkey

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
Responder Con Cita