Using Delphi; Sending text through email.

Hi everyone,

 Anybody here knows how to send a text strings from my richedit to this email address or to any addressee?
 and if anybody can add some special functionality like adding attachments.
 I will give an extra points.

Thanks in advance
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

girlswants_meAuthor Commented:
anybody can help?
Ferruccio AccalaiSenior developer, analyst and customer assistance Commented:
download my free component TAFQuickMail from\Downloads\ 
It let you send email using simplemapi to multiple addresses with multiple attachments using tmemo or trichedit for body-...
Source code is included

F68 ;-)

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
girlswants_meAuthor Commented:
How will i install this component? I tried to open but it said "Error creating form: Invalid stream format."
and i cannot compile because missing Variants.dcu
JavaScript Best Practices

Save hours in development time and avoid common mistakes by learning the best practices to use for JavaScript.

girlswants_meAuthor Commented:
OK im done installing it. The installation of the component was successful.

can you give me an example codes on how to use your component?
Eddie ShipmanAll-around developerCommented:
Here is an example using the Indy components.
This example shows how to create an HTML mail
with an inline, included jpg image.

  idAttach: TidAttachment;
  idText1: TidText;
  idText2: TidText;
  p: TidMessageParts;
  slBody: TStringList;
  idMessage1.Recipients[0].Address := '';
  p := idMessage1.MessageParts;
  slBody := TstringList.Create;
    // you can actually load the body from a RichEdit with
    // slBody.Text := RichEdit1.LinesText;
    slBody.Add('<br /><br /><b><font color="red">Here is the image:</font></b><br /><br /><br />');
    slBody.Add('<img src="cid:sm101yellow.jpg" />');
    idText1 := TidText.Create(p, slBody);
    idText1.ContentType := 'text/html';
    idText2 := TidText.Create(p);
    idText2.ContentType := 'text/plain';
    idText2.Body.Text := '';
    // This shows how to add an attachment
    idAttach := TidAttachment.Create(p, 'c:\sm101yellow.jpg');
    idAttach.ContentType := 'image/jpeg';
    idAttach.ContentDisposition := 'inline';
    idAttach.ExtraHeaders.Values['content-id'] := 'sm101yellow.jpg';
    idAttach.DisplayName := 'sm101yellow.jpg';
    idMessage1.ContentType := 'multipart/mixed';
girlswants_meAuthor Commented:
OK Thank you so much i raised the score to 150
girlswants_meAuthor Commented:
OK Thank you so much i raised the score to 150
Eddie ShipmanAll-around developerCommented:
did that help?
Ferruccio AccalaiSenior developer, analyst and customer assistance Commented:
Sorry for the delay girlswants_me....
In the zip file there's a demo too where you can look for a complete example on how to use it.
Let me know if you really used my suggestion or the EddieShipman one, because in this case points should be splitted to him.

F68 ;-)
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.