I'm trying to use the code and source I found here: to send an email from my program with an attachment.
I can run the source that I downloaded, but when I use that code I get error messages that none of the methods/properties are declared. Here's the code i'm trying to run:
the error messages are:[tt]
Undeclared identifier: 'Connect'
Undeclared identifier: 'Send'
Undeclared identifier: 'Connected'
Undeclared identifier: 'Disconnect'[/tt]
but if I go to the help, I can find
TIdSMTP.Connect - Opens a connection to the SMTP server.
Any ideas on what I'm doing wrong?
Leslie
In an open world there's no need for windows and gates
I can run the source that I downloaded, but when I use that code I get error messages that none of the methods/properties are declared. Here's the code i'm trying to run:
Code:
[navy][i]// for automatic syntax highlighting see faq102-6487
[/i][/navy]FrmMain.MailMessage.From.Address := frmMain.InfoArray[frmMain.JMSName];
[navy][i]//frmMain.MailMessage.Recipients.EMailAddresses := ToEmail;
[/i][/navy] frmMain.MailMessage.Recipients.EMailAddresses := [teal]'landrewsatmydomain'[/teal];
TIdAttachment.Create(frmMain.MailMessage.MessageParts, [teal]'C:\co406\test.txt'[/teal]);
[b]try[/b]
[b]try[/b]
frmMain.SMTP.Connect(1000);
frmMain.SMTP.Send(frmMain.MailMessage);
[b]except[/b] [b]on[/b] E:Exception [b]do[/b]
ShowMessage([teal]'ERROR: '[/teal] + E.Message);
[b]end[/b];
[b]finally[/b]
[b]if[/b] frmMain.SMTP.Connected [b]then[/b] frmMain.SMTP.Disconnect;
[b]end[/b];
the error messages are:[tt]
Undeclared identifier: 'Connect'
Undeclared identifier: 'Send'
Undeclared identifier: 'Connected'
Undeclared identifier: 'Disconnect'[/tt]
but if I go to the help, I can find
TIdSMTP.Connect - Opens a connection to the SMTP server.
Any ideas on what I'm doing wrong?
Leslie
In an open world there's no need for windows and gates