如何生成传真,并在code发送 [英] How to generate a fax and send it in code

查看:307
本文介绍了如何生成传真,并在code发送的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有业务需求,以生成传真并将其发送给收件人。我知道收件人的姓名和传真号码,也就是将附加的PDF文件。这一过程将每天运行,包括100条记录处理每个时间。我下的是IM pression,这可以通过发送电子邮件至传真机,并在Outlook中的快速测试来完成工作就好了。但是,如果我尝试做同样的事情在code,我得到的邮件地址是无效的错误。

I have a business requirement to generate a fax and send it to the recipient. I know the recipients name and fax number and there is a PDF that will be attached. This process will run daily and consist of 100 records to process each time. I was under the impression that this could be done by sending an email to the fax machine and a quick test in Outlook worked just fine. However, if I were to try and do the same thing in code, I get an error about the mail address being invalid.

MailMessage msg = new MailMessage();
msg.To.Add(new MailAddress("[Fax:myUser@5555555555]"));

我有哪些选择从code发送传真? (.NET)这些传真都是保密的性质......

What are my options for sending faxes from code? (.NET) These faxes are confidential in nature...


EDITED信息

EDITED INFO

我公司确实使用右传真。

My company does use Right Fax.

推荐答案

下面是一些code,可以帮助。这是使用权传真COM API库(rfcomapi.dll)

Here is some code that may help. This is using the Right Fax COM API Library (rfcomapi.dll)

RFCOMAPILib.FaxServerClass faxserver = new RFCOMAPILib.FaxServerClass();
faxserver.ServerName = "ServerName";
faxserver.Protocol = RFCOMAPILib.CommunicationProtocolType.cpNamedPipes;
faxserver.UseNTAuthentication = RFCOMAPILib.BoolType.True;
faxserver.OpenServer();

RFCOMAPILib.Fax fax = (RFCOMAPILib.Fax) faxserver.get_CreateObject(RFCOMAPILib.CreateObjectType.coFax);

// set up your 'fax' object the way you want it, below is just some sample options
fax.ToName = "John Doe";
fax.ToFaxNumber = "4255551111";
fax.ToVoiceNumber = "4255550000";
fax.ToCompany = "ACME";
fax.FromName = "My Company";
fax.FromVoiceNumber = "4255552222";

fax.Send();

这篇关于如何生成传真,并在code发送的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆