Improve company productivity with a Business Account.Sign Up

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 160
  • Last Modified:

Send an email

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
Azerthur
Asked:
Azerthur
  • 4
  • 3
  • 3
  • +5
1 Solution
 
d4jaj1Commented:
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
 
intheCommented:
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
 
intheCommented:
if you want a nice demo of using mapi see here:

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

 
d4jaj1Commented:
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
 
AzerthurAuthor Commented:
Adjusted points from 50 to 60
0
 
AzerthurAuthor Commented:
Delphi 3 standard, sorry no smtp component, maybe if you send the component....
0
 
AzerthurAuthor Commented:
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
 
JaymolCommented:
thionk
0
 
jeurkCommented:
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
 
JaymolCommented:
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
 
JaymolCommented:
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
 
darinwCommented:
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
 
AzerthurAuthor Commented:
I know, I went again to ICS but it still doesn't work !!!!!

;-(

Seems like I need a Tsmtpcli that is not included
0
 
bozo7Commented:
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
 
NetoManCommented:
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
 
intheCommented:
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
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

  • 4
  • 3
  • 3
  • +5
Tackle projects and never again get stuck behind a technical roadblock.
Join Now