简体   繁体   English

如何在MS Dynamics CRM的自定义工作流活动中获取SMTPHost?

[英]How to get SMTPHost in custom workflow activity in MS Dynamics CRM?

I am trying to send email in custom workflow activity using SMTPClient instead of using Email entity and SendEmailRequest in MS Dynamics CRM custom workflow activity. 我正在尝试使用SMTPClient在自定义工作流活动中发送电子邮件,而不是在MS Dynamics CRM自定义工作流活动中使用电子邮件实体和SendEmailRequest。

The reason I am doing this is because I want to send an calendar meeting invitation to the customer and not the email. 我这样做的原因是因为我想向客户发送日历会议邀请,而不是电子邮件。 For basics I got the code below: 对于基础知识,我得到以下代码:

MailMessage mail = new MailMessage("you@yourcompany.com", "user@hotmail.com");
SmtpClient client = new SmtpClient();
client.Port = 25;
client.DeliveryMethod = SmtpDeliveryMethod.Network;
client.UseDefaultCredentials = false;
client.Host = "smtp.google.com";
mail.Subject = "this is a test email.";
mail.Body = "this is my test email body";
client.Send(mail);

I intend to use DDay.iCal for the purpose. 我打算将DDay.iCal用于此目的。

Now this might seem to be a very basic question but I am stuck in how to get the Host name value in the custom workflow activity (instead of smtp.google.com). 现在,这似乎是一个非常基本的问题,但是我被困在如何在自定义工作流程活动(而不是smtp.google.com)中获取主机名值。

Please advise. 请指教。

Thanks, 谢谢,

I figured it out. 我想到了。 It was in my email router configuration in "Email Server" column. 它在“电子邮件服务器”列的我的电子邮件路由器配置中。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM