Solved

Send an email

Posted on 2000-04-05
16
141 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
  • 4
  • 3
  • 3
  • +5
16 Comments
 
LVL 3

Expert Comment

by:d4jaj1
Comment Utility
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
Comment Utility
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
Comment Utility
if you want a nice demo of using mapi see here:

http://www.bhnet.com.br/~simonet/archive/mapimail.zip
0
 
LVL 3

Expert Comment

by:d4jaj1
Comment Utility
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
Comment Utility
Adjusted points from 50 to 60
0
 
LVL 1

Author Comment

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

Author Comment

by:Azerthur
Comment Utility
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
Comment Utility
thionk
0
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 
LVL 4

Expert Comment

by:jeurk
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
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…
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

763 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

Need Help in Real-Time?

Connect with top rated Experts

6 Experts available now in Live!

Get 1:1 Help Now