مسخره تر از این مشکل وجود نداره . مشکلش یک & ناقابل قبل از TO بود
اینم کدش :
uses System.Web.Mail;
...
var
MailMessage : System.Web.MailMessage;
begin
mailMessage := MailMessage.create;
try
with mailMessage do
begin
From := 'abcd@aol.com';
&To := 'someone@somewhere.net';
Subject := 'This is the subject line';
Body := 'this is the mail body text;
BodyFormat := System.Web.Mail.MailFormat.Text;
end;
SmtpMail.SmtpServer := 'SMTPSERVER NAME';
SmtpMail.Send(mailMessage) ;
except on e : Exception do
MsgResult.Text := 'Error occured!';
end;
end;