JvMail (JEDI) component not sending mail

你。 提交于 2019-12-31 03:43:29

问题


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:mymail@gmail.com');
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 ?


回答1:


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:M@X.COM.

Description:

The following code adds a recipient to the Recipient list: JvMail1.Recipient.AddRecipient('SMTP:someone@somedomain.com', 'Some one');




回答2:


I don't provide any other solution or awesome in depth explanation on why you need to add smtp, so feel free to downvote this answer. :)

You already have a workaround, so instead I'll give some real world advice on how to fix this:

  1. Just prepend the damn smtp: via code if that's what it takes
  2. Write a TODO comment that says you need to figure out what's going on here
  3. Move on to your next task

Of course, unless sending email is really at the core of your application, or if you really have nothing better to do.



来源:https://stackoverflow.com/questions/23304163/jvmail-jedi-component-not-sending-mail

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!