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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Edit box writes to string variable 1

Status
Not open for further replies.

cartoonwally

Technical User
Sep 20, 2003
7
0
0
AU
I know this an easy question, but ive been trying for a few hours now and im yet to find out how the caption in an editbox (onchange) can be written to a variable?

 
You of course would have to put Zathras answer into the editbox's OnChange event.

[bobafett] BobbaFet [bobafett]

Everyone has a right to my opinion.
E-mail me at caswegkamp@hotmail.com
 
Alright, next question is how to reference variables

procedure mail;
//Include the ComObj unit in your unit as shown below
var
oEmail: Variant;
nResult: Boolean;

begin
oEmail := CreateOleObject('Dynu.Email');

//Please set a valid smtp server to be used to send email message.
oEmail.Host := smtphost;

//Set the to address. Multiple to addresses are supported.
oEmail.AddAddress('support@dynu.com');

//Set the cc addresses. Multiple cc addresses are supported.
oEmail.AddCC('sales@dynu.com');
oEmail.AddCC('service@dynu.com');

//Set the bcc address. Multiple bcc addresses are supported.
oEmail.AddBcc('info@dynu.com');

//Set the subject of the email
oEmail.Subject := 'Test';

//Set the body of the email
oEmail.Body := 'This is a test.';

//Set a file as attachment
oEmail.AddAttachment('c:\test.txt');

//Set the priority of message to HIGH(this step is optional)
oEmail.SetPriority(1);

//Send the emails.
nResult := oEmail.Send();
if nResult=True then begin;
MessageDlg('Emails sent successfully!', mtInformation, [mbOK], 0)
end;

if nResult=False then begin;
MessageDlg('Emails could not be sent!', mtInformation, [mbOK], 0);

end;
end;

I have a form that sets the smtp host using an editbox and then saves the text into a variable, i now need to reference the variable?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top