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?