Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

e-mail from delphi prog error 1

Status
Not open for further replies.

yomyom

Programmer
Dec 23, 2002
119
GB
Hi all,I'm trying to send email from my delphi program but I'm getting this error that I cannot resolve. Can anyone suggest what to do?
Thanks inadvance
Yomi.

This is the error:
ERROR: Socket Error # 10060
Connection timed out.
Status: Not connected.
Status: Disconnecting from 66.94.234.13.
Status: Connecting to 66.94.234.13.
Status: Resolving hostname yahoo.com.
 
Hi,

can you share a bit more information, like, what internet component are you using? (indy, ics,...). If you show us some code, it's more likely someone can help you...

--------------------------------------
What You See Is What You Get
 
I'm using the indy components as describe by zarko of aboutdelphi etc.
I'm connected by lan to the nextwork of my local cyber cafe.
I'm suspecting that perhaps I need to have a direct email account (with an ISP) on my own laptop.
I'm not sure if my assumption is correct. Does anyone know?

The other problem could be my inability to know what to fill for the host server parameter (edit box).

Even when I tried using MAPI with outlook (my system default), I got a no internet connection message.

All thoughts and help welcome.
Yomi.
 
Here's some code I used with Indy to e-mail myself at my hotmail account (I have my own e-mail server) if my ISP changed my home dynamic IP.

Code:
type
  TForm1 = class(TForm)
    Mail: TIdSMTP;
    MailMessage: TIdMessage;
    :


Begin
  // Below Host is my e-mail server
  // you would need a valid account (myuserid)
  // and password (mypassword) at a real ISP
  // You cannot just generically connect to Yahoo.com
  // and send e-mail
  // This could be for example smtp-server.rr.com if you
  // had an e-mail account with RoadRunner
  Mail.Host := '192.168.0.2'; 
  Mail.UserId := 'myuserid';
  Mail.Password := 'mypassword';
  Message.From.Address := 'mydomainname.com';
  MailMessage.From.Name:= 'My Name';
  MailMessage.From.Text:= 'Myuserid@mydomain.com';
MailMessage.Recipients.Add.Address := 'me@hotmail.com';      MailMessage.Subject := 'Router Address Changed';
 MailMessage.Body.Add('Router Address Change...');
 MailMessage.Body.Add('Router Address is '+ IP);
 Mail.Connect;
 Mail.Send(MailMessage);
 Mail.Disconnect;
End;
HTH,
JGS

Regards and HTH,
JGS
 
Thank you very much for clarifying my problem for me.
I'll obviously have to obtain an e-mail account.
Thanks once again.
Yomi.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top