Solved

Send an email

Posted on 2000-04-05
16
149 Views
Last Modified: 2010-04-04
I'm giving 50 pts for a fully working code doing the following things :
-send a mail to
     adress  : string                   with an object
     subject : string                    from the adress ( optionnal )
     origin    : string                    saying
     Memo1.lines.text

I need it to do it automatically without the user having to give any confirmation, it can use directly an smtp or just use the default maiiling program
     
   
0
Comment
Question by:Azerthur
[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
  • 4
  • 3
  • 3
  • +5
16 Comments
 
LVL 3

Expert Comment

by:d4jaj1
ID: 2687681
use the SMTP component (if you are using at least teh Professional version of D4+).  The component contains ALL of the items you mentioned.  In fact, you wold even have to convert any of teh items, so:

NNsmtp.body := memo1.lines;

will work just fine.  There's also a demo of this compoent in teh Delphi demos directory.  Let me know if you need additional help.

Jay

PS, if you want code examples, you may need to add some more points.
0
 
LVL 17

Expert Comment

by:inthe
ID: 2687854
d4jaj1 ,

>>PS, if you want code examples, you may need to add some more points.

thats not how e.e works.
if you propose your comment as the answer then if you can you should at least provide a quick demo,
what would it take ..2 minutes ..mm.
0
 
LVL 17

Expert Comment

by:inthe
ID: 2687856
if you want a nice demo of using mapi see here:

http://www.bhnet.com.br/~simonet/archive/mapimail.zip
0
Industry Leaders: 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 3

Expert Comment

by:d4jaj1
ID: 2687910
inthe,

that is howe this how this works, and i've been here a lot longer than you.  The 'customer' has a right to accept or reject any answer they choose - try not to think for them.  Also, my answer is my proposed answer - definitely don't attempt to thionk for me!
0
 
LVL 1

Author Comment

by:Azerthur
ID: 2688862
Adjusted points from 50 to 60
0
 
LVL 1

Author Comment

by:Azerthur
ID: 2688863
Delphi 3 standard, sorry no smtp component, maybe if you send the component....
0
 
LVL 1

Author Comment

by:Azerthur
ID: 2688872
The file offerered by inthe seems nice but unfortunately it doesn't work, I get a
A mapi compliant messaging application cannot be found in the system
0
 
LVL 6

Expert Comment

by:Jaymol
ID: 2689218
thionk
0
 
LVL 4

Expert Comment

by:jeurk
ID: 2689290
d4jaj1 :
>> i've been here a lot longer than you
that's a point, but :
d4jaj1 : 19941 points
vs
inthe : 298744 points
is a much better point for me.

What you state as an answer could only rejected.

The only answers that should be directly submitted as answers should come with the code.
We should answer a question only if we are sure it will be accepted as is...
The other times we should only comment questions. If the 'customer' likes your comment he will invite you to answer the question.

To compare the 'customer' satisfaction of you two :
Last 10 Grade(s) Received by d4jaj1 :  
B C B C C C C C C A
and
Last 10 Grade(s) Received by inthe:  
A A A A A A A A B B

sounds like your technic, d4jaj1, is not
the best.

And no, I don't know Inthe personnaly, and yes I know that he does not need me to argue against you.
It's just that I do not agree with your ee vision...

Regards.
John.
0
 
LVL 6

Expert Comment

by:Jaymol
ID: 2689337
I agree.  InThe has always given full and comprehensive answers, where required.  Also, I think it is rude to say "Well you give me more points and I'll do this for you."  I think that's a little playground-like really.

Nicely said John.  You the man.
0
 
LVL 6

Expert Comment

by:Jaymol
ID: 2689354
Another point - what is the point of ever posting an answer?????

Comments can be accepted as answers, so why even have the option of submitting an answer?
0
 
LVL 3

Expert Comment

by:darinw
ID: 2689450
Experts, please, lets get back on topic and cut the customer some slack, this is only his/her second question :)

Azerthur I think inthe actually gave you the tool for this in his answer to your question about FTP.

darinw
Customer Service
0
 
LVL 1

Author Comment

by:Azerthur
ID: 2689842
I know, I went again to ICS but it still doesn't work !!!!!

;-(

Seems like I need a Tsmtpcli that is not included
0
 
LVL 1

Expert Comment

by:bozo7
ID: 2689848
Azerthur,
Try these components. Thier documentations claims it will work with D3 Pro and greater. So it might not work with Standard, but it is worth a try.

http://sak.org.ar/html/sakemail.html
0
 
LVL 2

Expert Comment

by:NetoMan
ID: 2690858
There is a TEmail freware component that I use for doing something like that

You just drop this component in a form and with a functions like these you can send the email getting MAPI service.


TDModEmail Form :
------------------

..
..
..
type
  Email1: TEmail;

..
..
..


procedure TDModEmail.DModEmailCreate(Sender: TObject);
begin
     MailLogon;
end;


function TDModEMail.MailLogon: boolean;
begin
  if (Email1.Logon <> EMAIL_OK) then
  begin
    Result := False;
    ErrorMsg('MAPI can't connected.');
  end
  else
    Result := True;
end;

function TDModEMail.SendMail(ListRecept,ListCC,ListMsg,ListAttach:TStrings;
       sSubject :String): Boolean;
var
   I,Size : integer;
   P: Pchar;
   sMsg :string;
begin
     If (ListRecept.Count = 0) and (ListCC.Count = 0) Then
        Begin
             Result := False;
             Exit;
        End;
     If Not MailLogon Then
        Begin
             Result := False;
             Exit;
        End;
     sMsg := '';
     For I:= 0 To ListMsg.Count-1 do
     Begin
          sMsg := sMsg + ListMsg.Strings[I] + Chr(13);
     End;
     Email1.Recipient := ListRecept;
     Email1.CC := ListCC;
     Email1.Attachment := ListAttach;
     Email1.SetLongText(PChar(sMsg));
     Email1.Subject := sSubject;
     if (Email1.SendMail <> EMAIL_OK) then
        ErrorMsg('MAPI its not available')
        else
            Result := True;
end;

Check for this component.. there is in some web recources. If you want, I can send it to you.

Hope This Helps!
0
 
LVL 17

Accepted Solution

by:
inthe earned 60 total points
ID: 2691289
hi,
well unfortunatly i doubt TEmail will work as it sounds  like the system has no mapi installed so smtp type comp is the only way to go,
well you could download free winshoes components (similar to ics of f.piette but a little easier to use)
www.pbe.com/winshoes
install these and  look at the smtp demo in the demos dir .
it shows all ,including sending the email with an attachment.
(can also look at mailDLL demo for another way)
Regards Barry

 
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…
Suggested Courses
Course of the Month6 days, 1 hour left to enroll

627 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