Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

how to send E-MAIL with delphi, automatically?

Posted on 2003-11-03
21
360 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
Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

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.

 
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
 
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

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.

Question has a verified solution.

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

The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
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…
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…

839 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