Menu

How to attach camera pic to mail compose?

Chris
2014-01-21
2014-01-21
  • Chris

    Chris - 2014-01-21

    hi
    I have been trying to attach a picture from the camera and send it out via email but failed.
    can help?
    When i receive the email, the picture is not there. why?

    please help
    thanks
    chris

    =========== source ============
    procedure TForm1.DPFUIImagePickerController1DidFinishPickingSavedImage(
    Sender: TObject; FileName: string);
    var
    SL: TStringList;
    l_filename : string;
    begin
    // cc : once finished picking the image from gallery
    // ShowMessage('Filename: ' + Filename);
    SL := TStringList.Create;
    try
    SL.Add( 'This is a sample attachment file content. create by TDPFMailCompose' );
    l_filename := Filename;
    SL.SaveToFile( l_filename );
    if not DPFMailCompose1.MailCompose( 'Testing Subject', 'This is my test', true,
    ['chuahyen@hotmail.com'], [], [], [l_filename] ) then
    ShowMessage( 'Sorry' + #10#13 + 'You cant send eMail '#10#13 + '1) Your Device not support eMail Compose' + #10#13 + '2) You not have a Mailbox' );
    finally
    SL.Free;
    end;
    end;
    ==========================

     
  • Chris

    Chris - 2014-01-21

    Hi
    Its ok. Its my fault.
    The problem is solved.
    I should NOT save the string list to the filename.

    thanks
    chris

     
  • Chris

    Chris - 2014-01-21

    Hi
    Now i have another problem. Is it possible not the display the MailCompose form?
    I just want to send it out immediately once the "send mail" button is pressed.

    please advise
    thanks
    chris

     
  • Babak Yaghoobi

    Babak Yaghoobi - 2014-01-21

    Hi Chris

    You cannot send Email without user acceptance,
    For sending without user acceptance, mu be use SMTP (like indy).

    Regards

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.