delphi - Sending Email with signature -
i have been using:
shellexecute(self.handle, nil, pchar(format('mailto:%s ?subject=assunto: &body=',[_lemails ])), nil, nil, sw_normal);
to send emails. no body text users have automatic signatures in emails clients automatically.
now want enable users insert text well, if text gets there no signature. there way "force" this.
thanks
you can use mapi instead (the messaging applications programming interface
), gives better control on email, , allows things attachments. can choose whether show user's email client "compose" window or add directly outbox. (the outbox functionality restricted because of changes windows security, ms outlook concerned.)
the quickest, easiest way use jedi code library jclemail
. it's wrapper around simplemapi, makes easy (code taken older app, , based on sample jcl demo):
email := tjclemail.create; try email.recipients.add(ansistring(emailaddress), ansistring(emailname)); email.subject := ansistring(subject); email.body := ansistring(body); email.htmlbody := false; // true if it's html email // send attachment if wanted email.attachments.add(ansistring(filename)); email.send(true); // true show default email, false add outbox email.free; end;
the drawback simplemapi
may short-term solution (although it's still around in win7 64-bit , earlier, can't speak windows 8). according msdn,
[the use of simple mapi discouraged. may altered or unavailable in subsequent versions of windows.]
the drawback mapi
relies on mapi
client being installed. fortunately, software supports mailto
should support mapi
well; outlook does, instance, , mozilla thunderbird.
Comments
Post a Comment