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;
==========================
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
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
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
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;
==========================
Hi
Its ok. Its my fault.
The problem is solved.
I should NOT save the string list to the filename.
thanks
chris
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
Hi Chris
You cannot send Email without user acceptance,
For sending without user acceptance, mu be use SMTP (like indy).
Regards