Link to home
Start Free TrialLog in
Avatar of jpcs
jpcs

asked on

use delphi to send e-mail via outlook

is there any way to put in the outbox folder under outlook express, a message to an email written in a textbox, and with an attachment, without using outlook, just A single delphi program?

Please post full code.
Avatar of ZifNab
ZifNab

Hi jpcs,

procedure TForm1.Button1Click(Sender: TObject);
       var
         TempUrl : string;
       begin
         TempUrl:='mailto:tom.deprez@village.uunet.be?subject=Your subject&body=test body';

       ShellExecute(Application.Handle,'open',PChar(TempURL),nil,nil,SW_NORMAL);
       end;

you can use this for outlook, but I don't think it's possible to send attachements.

To send attachments, use MAPI, but Outlook isn't MAPI compliant.  Exchange is.

So, I guess you've to make a tough descision.

Zif.
I do not entirly understand your question.

Do you want to start a email message box from Outlook without starting outlook entirly? Or do you want to create a message compatible with outlook?
jpcs:::      to use ShellExecute, you have to add SHELLAPI to the Uses clause

( uses  Windows, Messages, SysUtils, Cla... )

hey Zif, it works perfectly !

bryan =)

thanks for the support bryan :-)
Avatar of jpcs

ASKER

Sorry for the delay... been absent.

I can't accept the answer, because Outlook is possible to the  MAPI client as default (set it up in options), and I know it's possible to do wat I want, since Photo Shop 5 does it... (If you have an image opened and click on send in the File menu, it opens outlook in a new message and the message is in the attachments section.

Sorry.
ASKER CERTIFIED SOLUTION
Avatar of ZifNab
ZifNab

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial