Search code examples
delphidelphi-xe4jedi

JvMail (JEDI) component not sending mail


JvMail component is not functioning right or I am messing something up.

procedure TForm1.RzURLLabel1Click(Sender: TObject);
begin
if cxLookUpComboBox1.Text ='' then
abort else
with JvMail1.SimpleMAPI do
begin
JvMail1.Clear;
JvMail1.Recipient.AddRecipient('smtp:[email protected]');
JvMail1.Subject := 'Password lost  ';
JvMail1.Body.Text := 'Request password  :' +#13#10+  cxLookUpComboBox1.Text +#13#10+  AdvOfficeStatusBar1.Panels[4].Text ;
JvMail1.SendMail;
end
end;

My mail does not get sent unless I put the prefix 'smtp:' infront of the mail adress. Any ideas on how to fix this ?


Solution

  • The documentation is clear to that

    Notes:

    The format of an address specified by parameter Address is [address type][e-mail address]. Examples of valid addresses are FAX:206-555-1212 and SMTP:[email protected].

    Description:

    The following code adds a recipient to the Recipient list: JvMail1.Recipient.AddRecipient('SMTP:[email protected]', 'Some one');