Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

send email

Posted on 2000-03-20
6
Medium Priority
?
194 Views
Last Modified: 2010-04-04
I want to send e-mail to a given recipient. The problem is that there should be a file attached. I use mailto, but don't know how to attach the file.
0
Comment
Question by:simoraikov
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
6 Comments
 
LVL 12

Expert Comment

by:rwilson032697
ID: 2635514
You can't send an attachment using ShellExecute.

There is good example in delphi\demos\intenet\smtp directory of how to send an email with attachments.

Here is a piece of code Barry (inthe) has posted before showing how to do it:


procedure TForm1.Button1Click(Sender: TObject);
begin
  if not(nmsmtp1.Connected)
  then begin
    nmsmtp1.Host:= 'mail.enterprise.net';
    nmsmtp1.UserID := 'your userid';
    nmsmtp1.Connect;
  end;

  if nmsmtp1.Connected
  then
  begin
    nmsmtp1.ClearParams := True;
    nmsmtp1.SubType := mtPlain;
    nmsmtp1.EncodeType := uuMime;
    nmsmtp1.PostMessage.FromAddress := 'Legend@Enterprise.Net';
    nmsmtp1.PostMessage.ReplyTo := nmsmtp1.PostMessage.FromAddress;
    nmsmtp1.PostMessage.FromName := 'Barry';
    nmsmtp1.PostMessage.ToAddress.Add('BorgsAssmilate@Aol.Com');
    nmsmtp1.PostMessage.Body.AddStrings(Memo1.lines);
    nmsmtp1.PostMessage.Subject := 'A Test';
    nmsmtp1.PostMessage.Date := DateToStr(Date);
    nmsmtp1.SendMail;
    MessageDlg('Mail sent', mtInformation, [mbOk], 0);
  end
  else
    MessageDlg('NOT connected', mtInformation, [mbOk], 0);
end;

Cheers,

Raymond.
0
 
LVL 1

Author Comment

by:simoraikov
ID: 2635528
I want to do it using Outlook !
0
 
LVL 13

Expert Comment

by:Epsylon
ID: 2635591
Perhaps this is what you are looking for:

http://www.djpate.freeserve.co.uk/AutoOutl.htm
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 15

Accepted Solution

by:
simonet earned 400 total points
ID: 2635594
Here it goes:

1) Set Outlook as the Default MAPI client. One of the options in Outlook is to make the default MAPI program.

2) Go to http://www.bhnet.com.br/~simonet/howtoprojs.htm and download the "How to send e-mail and faxes from your Delphi/C++ Builder application" sample application. In it you'll find full source, well documented code on how to use MAPI to send e-mail.

Yours,

Alex
0
 
LVL 13

Expert Comment

by:Epsylon
ID: 2635812
I think that the solution I pointed at in my previous comment offers you more control over outlook.
0
 
LVL 1

Author Comment

by:simoraikov
ID: 2635861
Right. I'll make a new 100p question for you. Just answer it!!

10x
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…
Despite its rising prevalence in the business world, "the cloud" is still misunderstood. Some companies still believe common misconceptions about lack of security in cloud solutions and many misuses of cloud storage options still occur every day. …
Suggested Courses

610 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question