Sending files over internet

Any ideas how to send a file and message within Delphi program to the recipient over the internet so that recipient would be able to read the message and see a file as an attachment in his/her e-mail program.
MalensekAsked:
Who is Participating?
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.

PeterLarsenCommented:
Use TNMSMTP.

Regards
Peter
0

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
PeterLarsenCommented:
Like this :

var
 mail : TNMSMTP
begin

mail:=NMSMTP1.create(self); //or just place it on the form
Mail.PostMessage.Subject:='Some text';
Mail.Host:='MailServerName';
Mail.Port:=25;
Mail.UserID:='Your name - not very important';
Mail.PostMessage.FromAddress:='Your mail address';
Mail.PostMessage.FromName:='Your name - not very important';
Mail.PostMessage.ToAddress.Clear;
Mail.PostMessage.ToAddress.Add('E-mail address');
Mail.PostMessage.Attachments.Clear;
Mail.PostMessage.Attachments.Add('a file name');
Mail.PostMessage.Body.Text:='E-mail body - text';
Mail.Connect;
Mail.SendMail;
Mail.Disconnect;

/PL
0
RadlerCommented:
Hi Peter,

A help, please. A friend tried use this code and always appear a addtional blank line at the first line of the message body. You with your experience can avoid this ?

T++, Radler.
0
Cloud Class® Course: Microsoft Windows 7 Basic

This introductory course to Windows 7 environment will teach you about working with the Windows operating system. You will learn about basic functions including start menu; the desktop; managing files, folders, and libraries.

rwilson032697Commented:
Listening
0
PeterLarsenCommented:
Nice try, Radler  :-)

Well, i dont understand this - i dont get a blank line at the beginning.

I will get back to you later this evening.
0
PeterLarsenCommented:
Radler,

This blank line, you'r talking about, is it only there if you have attachments ??

Anyway, i think it will help if you add more lines to the body - like this :

Mail.PostMessage.Body.clear;
Mail.PostMessage.Body.Add('1. line');
Mail.PostMessage.Body.Add('Next line');
Mail.PostMessage.Body.Add('Next line');
Mail.PostMessage.Body.Add('Next line');
Mail.PostMessage.Body.Add('Next line');
Mail.PostMessage.Body.Add('Next line');

or

var
T : string;
begin
 T:='A  line'+chr(13)+chr(10)+chr(13)+chr(10)+chr(13)+chr(10)+chr(13)+chr(10);
 Mail.PostMessage.Body.Text:=T;
.....

Hope this help.
Peter
0
RadlerCommented:
I can't answer Peter, I'll ask to my collegue. The first option I guess to him too, and the result was negative. The second is another way, who knows ?
Wait for new comments.

T++, Radler.
0
PeterLarsenCommented:
Radler, I would alså like to know what program that receives the mails.
0
RadlerCommented:
Sorry, I'll invite my friend to participate from E-E. He can provide this.

T++, Radler.
0
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
Delphi

From novice to tech pro — start learning today.