Solved

Using Delphi; Sending text through email.

Posted on 2003-11-11
9
753 Views
Last Modified: 2010-04-05
Hi everyone,

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

Thanks in advance
0
Comment
Question by:girlswants_me
  • 5
  • 2
  • 2
9 Comments
 

Author Comment

by:girlswants_me
ID: 9729311
anybody can help?
0
 
LVL 22

Accepted Solution

by:
Ferruccio Accalai earned 150 total points
ID: 9729353
download my free component TAFQuickMail from www.afsoftware.it\Downloads\afquickmail.zip 
It let you send email using simplemapi to multiple addresses with multiple attachments using tmemo or trichedit for body-...
Source code is included

F68 ;-)
0
 

Author Comment

by:girlswants_me
ID: 9737005
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
0
Simplifying Server Workload Migrations

This use case outlines the migration challenges that organizations face and how the Acronis AnyData Engine supports physical-to-physical (P2P), physical-to-virtual (P2V), virtual to physical (V2P), and cross-virtual (V2V) migration scenarios to address these challenges.

 

Author Comment

by:girlswants_me
ID: 9737038
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?
0
 
LVL 26

Expert Comment

by:EddieShipman
ID: 9737044
Here is an example using the Indy components.
This example shows how to create an HTML mail
with an inline, included jpg image.

var
  idAttach: TidAttachment;
  idText1: TidText;
  idText2: TidText;
  p: TidMessageParts;
  slBody: TStringList;
begin
  idMessage1.Recipients.Add;
  idMessage1.Recipients[0].Address := 'girlswants_me@yahoo.com';
  p := idMessage1.MessageParts;
  slBody := TstringList.Create;
  try
    // you can actually load the body from a RichEdit with
    // slBody.Text := RichEdit1.LinesText;
    slBody.Add('<html>');
    slBody.Add('<head>');
    slBody.Add('</head>');
    slBody.Add('<body>');
    slBody.Add('<br /><br /><b><font color="red">Here is the image:</font></b><br /><br /><br />');
    slBody.Add('<img src="cid:sm101yellow.jpg" />');
    slBody.Add('</body>');
    slBody.Add('</html>');
    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';
    idMessage1.Body.Assign(slBody);
    idAttach.DisplayName := 'sm101yellow.jpg';
    idMessage1.ContentType := 'multipart/mixed';
    idSMTP1.Connect;
    idSMTP1.Send(idMessage1);
  finally
    idSMTP1.Disconnect;
    slBody.Free;
    Showmessage('done');
  end;
end;
0
 

Author Comment

by:girlswants_me
ID: 9737086
OK Thank you so much i raised the score to 150
0
 

Author Comment

by:girlswants_me
ID: 9737094
OK Thank you so much i raised the score to 150
0
 
LVL 26

Expert Comment

by:EddieShipman
ID: 9737287
did that help?
0
 
LVL 22

Expert Comment

by:Ferruccio Accalai
ID: 9737718
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 ;-)
0

Featured Post

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Mydac connection data base issue 3 157
How to define IfThen functions in one common unit? 4 54
Performance of SQL statement 37 111
Base1 Encode/Decode 3 77
Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
This Micro Tutorial will teach you how to censor certain areas of your screen. The example in this video will show a little boy's face being blurred. This will be demonstrated using Adobe Premiere Pro CS6.
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…

778 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