Solved

how to send E-MAIL with delphi, automatically?

Posted on 2003-11-03
21
354 Views
Last Modified: 2010-04-05
HI, and thanks to pay attention to me.

I want to know that, how can I send my an email from my computer without automatically? means that I don't want to go to server site for example "yahoo" or "hotmail" or ... , and send it just for running my own program. and ALSO no other programs, like "outlook" or ... , interupts me.

hope you to understand the meaning of "automatic".

Thank you again for your attention.
0
Comment
Question by:mehdi_m
  • 8
  • 7
  • 3
  • +2
21 Comments
 
LVL 26

Expert Comment

by:EddieShipman
ID: 9674495
Use the TidSMTP component from Indy. It is included with Delphi versions 6 and 7
and can be downloaded for other versions from:
http://www.nevrona.com/indy

0
 
LVL 1

Expert Comment

by:JackNaif
ID: 9675929
Or if you're using Delphi 5 you can check the TNMSMTP.
0
 
LVL 5

Expert Comment

by:DeerBear
ID: 9677453
Hi,

To get you started with Indy, you have to:

1) Add a TIdMessage component
2) Add a TIdSMTP component

then write the following

SMTP1.Connect;
SMTP1.Send( Message );
SMTP1.Disconnect;

HTH,

Andrew
0
 
LVL 26

Expert Comment

by:EddieShipman
ID: 9678014
JackNaif, please do not recommend NM components to anyone, they are buggy and haven't been
updated since 1998. I don't care if they are installed with D4 and D5, You can get Indy for free and
then even include source code, unlike the NM componnets.

It is my mission to get those components wiped from the face of the earth. One of the worst
business descisions ever by Borland. Glad they are gone from the install...
0
 
LVL 1

Expert Comment

by:JackNaif
ID: 9679188
All right, all right! =)

I'll try the Indy components and let you know if I liked them better or not...
0
 

Author Comment

by:mehdi_m
ID: 9690903
ok.

but I cannot find the target email address field ?
can you make a better example 4 me?

thank you.

mehdi
0
 
LVL 26

Expert Comment

by:EddieShipman
ID: 9691811
you have a Recipients property that is a stringlist. Add your recipients to the stringlist.
0
 
LVL 6

Expert Comment

by:swift99
ID: 9691848
0
 

Author Comment

by:mehdi_m
ID: 9704554
I fill all properties with a target email
 
  IdMessage1.BccList[0]
  IdMessage1.CCList[0]
  IdMessage1.From.Address
  IdMessage1.ReceiptRecipient.Address
  IdMessage1.Recipients[0]
  IdMessage1.ReplyTo[0]
  IdMessage1.Sender.Address

like "name@yahoo.com". and it closes gracefully. but no email will be sent to target email.

should I use username, password properties.
can you explain about host property?

thank you.

mehdi


0
 

Author Comment

by:mehdi_m
ID: 9704577
and I forgot,

what mail (SMTP) server can I use in internet, that is FREE?
of course IF I must use one!???
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 6

Expert Comment

by:swift99
ID: 9704629
ICS POP3 server (http:overbyte.delphicenter.com).
0
 
LVL 26

Expert Comment

by:EddieShipman
ID: 9705298
Free SMTP services are very difficult to come by, otherwise, spammers would use them
greatly.

You have an ISP, correct? Why don't you use your own for testing and have your users
configure theirs for use with your software?

Host is the SMTP server, username and password are your account info.
0
 

Author Comment

by:mehdi_m
ID: 9708395
EddieShipman.
can you explain more.

I have yahoo and hotmail mail account.
can I use them? if yes what is the server name for them?

and can you please tell MORE EXACTLY about filling properties of IdSMTP component! because I'm not expert as you :(   ;)

thank you.

mehdi
0
 
LVL 26

Expert Comment

by:EddieShipman
ID: 9716260
No, Yahoo and Hotmail have both discntinued their smtp
services.

What program do you ue to send and receive email?
0
 

Author Comment

by:mehdi_m
ID: 9718695
I'm wanna write a program! don own anything!

I want to send e-mail without notifying me! send by a click when online.
what can I do with components said as above.
it's so much better that you give me a sample. (if you can!)

mehdi
0
 
LVL 26

Expert Comment

by:EddieShipman
ID: 9718929
I NEED MORE INFORMATION if I am going to give you an example.
I can not set the correct properties for idSMTP without knowing the
properties of your ISP.

I just guess I don't understand what you are trying to do.
0
 
LVL 6

Expert Comment

by:swift99
ID: 9722318
The Indy examples should have what you need.  Have you checked out the project Jedi web site?
0
 
LVL 26

Expert Comment

by:EddieShipman
ID: 9722936
Actually, the Indy samples are located here:
http://www.indyproject.org/indy/demodownloads/I9D6_Demos_24Nov02.zip
0
 

Author Comment

by:mehdi_m
ID: 9852865
Dear EddieShipman.

what kind of properties should you know from my ISP. can you explain more about it. I think it is not important to know the exact values, that will work. just make an example for me which sends message into a target e-mail (without intrupting sender-user if possible). and you can explain about those properties which you don know instead of filling them. please.

Thank you.

mehdi
0
 
LVL 26

Accepted Solution

by:
EddieShipman earned 500 total points
ID: 9852973
Host is the SMTP server, Username and Password are your account info.
Get this from your account settings in your regular email client, what is your
regular email client, anyway?

Please do not post your info on this forum.

The idSMTP properties above relate to the same info for your ISP. i.e.


  idSMTP1.Host := 'smtp.server.myisp.com';
  idSMTP1.UserName := 'MyUserAccountName';
  idSMTP1.Password := 'myaccountpassword';
0
 

Author Comment

by:mehdi_m
ID: 10535937
Thank you  Eddie and sorry about a long delay of answering.
Pings are your right.
:)
mehdi
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
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…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

746 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

13 Experts available now in Live!

Get 1:1 Help Now