This topic has been archived. It cannot be replied.
-
工作学习 / 学科技术讨论 / 想写一个小程序, 功能:分析一个文本文件,提取里面的部分信息,然后自动生成email发送出去。现在不知道怎么能够“自动生成email并且发送出去”, 那位知道能否指点一下?
-volunteer(angel);
2008-1-4
(#4162570@0)
-
不是啥难事。但你这样问倒也不易解释清楚,假设你用OUTLOOK,就找点程序中如何用OUTLOOK的部件的文章吧,简单;如果啥部件都不用,就的按SMTP协议自己做个部件,没做过可能有点难度。许多开发环境都提供SMTP部件。
-tjhong(我检讨);
2008-1-4
(#4162614@0)
-
用sendmail巴,写个一行script. 基本上是 letter="From: To: Subject: blah blah"; echo $letter | sendmail -t xxx 什么的
-hillman(山大王);
2008-1-4
(#4162634@0)
-
谢谢回答!! 我用c#试了一下,怎么也调不通。也用了smtp类。 我希望程序越简单越好。有做过类似的吗?
-volunteer(angel);
2008-1-5
(#4164802@0)
-
两种方法: 1. 用SmtpMail 类和MailMessage类(需要设置SmtpServer ); 2.用SQL Server SendMail存储过程 (需要安装和设置Outlook)
-digitworm(digitworm);
2008-1-5
(#4164934@0)
-
i am using Smtpclient, when using yahoo mail, got an error: "You are not authorized to send mail, authentication is required", when i use gmail, got an error: "the operation has time out". the settings and code are the same as the other programers.i am using Smtpclient, when using yahoo mail, got an error: "You are not authorized to send mail, authentication is required", when i use gmail, got an error: "the operation has time out". the settings and code are the same as the other programers. i checked this link: http://www.aspxboy.com/private/5568/default.aspx , but mine still does not work. BTW, i am using c#. anyone can help?
-volunteer(angel);
2008-1-6
{391}
(#4166564@0)
-
It looks like you need credential info for authorization.Try following code to provide credential info:
SmtpClient client = new SmtpClient();
client.Host = "HOST Server IP/Name";
client.Port = Port Number;
client.Credentials = new System.Net.NetworkCredential("Uer_ID", "Pass Word", "Domain");
client.Send(...);
HTH
-deep_blue(BLUE);
2008-1-7
{277}
(#4168217@0)
-
i tried, it still does not work. maybe the 2008 c# and the frame work have sme tricks?
-volunteer(angel);
2008-1-8
(#4172922@0)
-
I don't think so. If you really doubt about .NET FW 3.5, you can switch FW to 2.0.BTW, did you configure outlook (or outlook express) in your computer to connect to yahoo mail? If not, have it done and to see if it works or not.
-deep_blue(BLUE);
2008-1-9
{147}
(#4173290@0)
-
yes, i configured my outlook express in several computers to connect to the yahoo mails, I used out look for several years. no any problems. wierd
-volunteer(angel);
2008-1-9
(#4173337@0)
-
If you tried every thing of SmtpClient unsuccessfully, the workaround is to try Outlook automation.
-deep_blue(BLUE);
2008-1-9
(#4173440@0)
-
Use Perl is simple,几句话。我有Java 的例子,也非常简单。
-foolzz(foolzz);
2008-1-6
(#4166055@0)
-
i used Perl to do this.
-redspider(红蜘蛛);
2008-1-5
(#4164011@0)
-
这件事分成两步来做. 第一步,分析文件, 生成email所有的信息, recipient, subject, body, etc, .NET中方法有很多; 第二步, 把EMAIL发出去, 见连接. yahoo, gmail等的smtp不一定能随便用的, 反正我记得以前是用一个工具, 才能access locally.
-poohbear(毛毛熊);
2008-1-6
(#4166691@0)
-
I list the code here, everything is ok, build successfully. when try to send the email, got the error: The SMTP server requires a secure connection or the client was not authenticated.
-volunteer(angel);
2008-1-7
{946}
(#4169616@0)
-
If your program and version are not listed above, you may have trouble connecting to the Yahoo! Mail SMTP servers. Yahoo! does not support other programs and versions.
-tjhong(我检讨);
2008-1-7
(#4169674@0)
-
program and version? Can you explain it? which program and version should I specify?
-volunteer(angel);
2008-1-7
(#4169704@0)
-
http://help.yahoo.com/help/us/bizmail/pop/pop-11.html
-tjhong(我检讨);
2008-1-7
(#4169810@0)
-
要是你的机器安装smtp service了,用localhost吧
-tjhong(我检讨);
2008-1-7
(#4169818@0)
-
i pay yahoo for the service. the problem is i could not send email by gmail either. and how can I set up the smtp service , local host? Thanks again.
-volunteer(angel);
2008-1-7
(#4170140@0)
-
Remove defaultCredentials="true" from configurationIf you set defaultCredentials to true and specify a user name and password, the default network credential is used, and the basic authentication data is ignored.
-deep_blue(BLUE);
2008-1-8
{161}
(#4170651@0)
-
很有可能
-tjhong(我检讨);
2008-1-8
(#4170730@0)
-
i removed Remove defaultCredentials="true" from configuration , but the error is the same
-volunteer(angel);
2008-1-8
(#4171120@0)
-
那就是不支持他人自行开发的发送邮件程序。一般MAIL SERVER只允许局域网内部的程序自动发送MAIL。反向思维以下,全世界千白万程序员,只要有一个人使坏,就可以是MAIL SERVER瞬间超载。
-tjhong(我检讨);
2008-1-8
(#4171166@0)
-
gmail 应该支持他人自行开发的发送邮件程序, 我查了许多例子,很多人都在用。
-volunteer(angel);
2008-1-8
(#4171206@0)
-
我是成功用过YAHOO转发的(仅作测试),还是用的免费信箱,PORT用缺省值(25)。没看到你的环境,原因很多,比如你的机器装了防病毒程序等。
-tjhong(我检讨);
2008-1-8
(#4171234@0)
-
你看了我的code吗? 哪儿有什么不对的?请指点一下,我用vista, c#2008. 几台机子都试过了。没装防病毒程序。真是奇怪呀。要不post你的程序我看一看?
-volunteer(angel);
2008-1-8
(#4171260@0)
-
我用了yahoo的普通邮箱试了一下,port 25 doesnot work. if using port 587, the same error. i checked your code, it is exactly the same as mine. the difference is i use 2008 c# and win vista. 怪了。 maybe 哪儿的设置有问题?
-volunteer(angel);
2008-1-8
(#4172288@0)
-
估计还是你的代码有问题。注册个信箱,把代码原封不动地贴上来看看。
-tjhong(我检讨);
2008-1-9
(#4173653@0)
-
ok, here it is,代码原封不动地贴上来了。 是一个win application, i added a button, when i click the button, 执行代码。
-volunteer(angel);
2008-1-9
{1188}
(#4173710@0)
-
Try this: client.Credentials = new NetworkCredential("gysun2222", "197510");
-tjhong(我检讨);
2008-1-9
(#4173726@0)
-
tried just now, no luck. when you used it, it works?
-volunteer(angel);
2008-1-9
(#4173764@0)
-
Yes
-tjhong(我检讨);
2008-1-9
(#4173772@0)
-
i still got the same error as follows, and the program is "no response", when i close it, "vshost.exe not response" , i am using vista, 2008 c#,The SMTP server requires a secure connection or the client was not authenticated. The server response was: authentication required - for help go to http://help.yahoo.com/help/us/mail/pop/pop-11.html,
-volunteer(angel);
2008-1-9
{199}
(#4173834@0)
-
还是有些不一样的,我说的是我在www.yahoo.ca走通,你一直在www.yahoo.com上转,再试试吧。
-tjhong(我检讨);
2008-1-9
(#4173960@0)
-
另外我用PORT=25
-tjhong(我检讨);
2008-1-9
(#4173982@0)
-
Outgoing (SMTP) Server: smtp.mail.yahoo.com (Use SSL, port: 465, use authentication)
-niu1986(只吃草的牛);
2008-1-9
(#4173992@0)
-
刚刚用你的信箱试试,我也有一样的问题。看来www.yahoo.ca上注册的信箱可以,www.yahoo.com注册的不行
-tjhong(我检讨);
2008-1-9
(#4174011@0)
-
port 25 works? it never worked for me, it does not matter where i am(Canada, USA), i can use port 587 only, and it seems yahoo does not use SSL, i tried port 465, does not work either. BTW, you use prot 25 or port 465?
-volunteer(angel);
2008-1-9
(#4174043@0)
-
Take a look at my code. I didn't set port at all. I use default.
-tjhong(我检讨);
2008-1-9
(#4174053@0)
-
i tried gmail, the error is different: the operation has time out. code 本身好像没问题,不知道问题出在哪儿。
-volunteer(angel);
2008-1-9
(#4174178@0)
-
嘿嘿,我首先用dnslookup找到对方mail server的ip,然后直接用socket连对方的port 25,用smtp协议发,除了有时候会进去垃圾箱,都不错。
-guestagain(guest again);
2008-1-8
(#4171278@0)
-
dnslookup
-guestagain(guest again);
2008-1-8
{17033}
(#4171280@0)
-
Why didn’t you look at System.Net.Dns?
-deep_blue(BLUE);
2008-1-9
(#4173529@0)
-
smtpclient
-guestagain(guest again);
2008-1-8
{13580}
(#4171293@0)
-
以上是大概3年前在dotnet 1.1上用c#写的,要转发也可以,直接从本机发也可以。现在有些smtp server限制的更严了,可能发不到,主要是本机ip地址的问题,不过没心情改了。可以参考一下。
-guestagain(guest again);
2008-1-8
(#4171299@0)
-
程序能连到server, but 要求授权(yahoo)或连接超时(gmail),用户名和密码都正确。就是找不到原因。我联系了yahoo, yahoo 也说没问题,我看我的CODE好像也没问题。代码没几行。 真急人。
-volunteer(angel);
2008-1-9
{950}
(#4174220@0)
-
我的信箱是5年前注册的,刚刚上网看了看,好象亚虎对免费信箱不支持. Account Name/Login Name: Your Yahoo! Mail ID (your email address without the "@yahoo.com")
-tjhong(我检讨);
2008-1-9
(#4174275@0)
-
我这个邮箱was registered 7 years ago. and I am using the paid yahoo service. yahoo told me it should be ok.
-volunteer(angel);
2008-1-9
(#4174296@0)
-
Try username without @yahoo.com
-tjhong(我检讨);
2008-1-9
(#4174339@0)
-
tried, not work
-volunteer(angel);
2008-1-9
(#4174344@0)
-
我用telnet试了一下,你的用户名和密码无法登陆。我这里port 25没有问题。U:\>telnet smtp.mail.yahoo.com 25
220 smtp103.plus.mail.re1.yahoo.com ESMTP
HELO
250 smtp103.plus.mail.re1.yahoo.com
AUTH LOGIN
334 VXNlcm5hbWU6
gysun2222@yahoo.com
501 malformed auth input (#5.5.4)
535 authorization failed (#5.7.0)
U:\>telnet smtp.mail.yahoo.com 25
220 smtp108.plus.mail.re1.yahoo.com ESMTP
HELO test
250 smtp108.plus.mail.re1.yahoo.com
AUTH LOGIN
334 VXNlcm5hbWU6
gysun2222
334 UGFzc3dvcmQ6
197510
535 authorization failed (#5.7.0)
-guestagain(guest again);
2008-1-9
{474}
(#4174281@0)
-
can not sign in? i can sign in using the IE.
-volunteer(angel);
2008-1-9
(#4174298@0)
-
登陆web界面没问题,但是不能login smtp server
-guestagain(guest again);
2008-1-9
(#4174304@0)
-
不好意思,发用户名和密码的时候忘了BASE64编码了。我再试试。
-guestagain(guest again);
2008-1-9
(#4174319@0)
-
还是不行,你还是问问yahoo吧。
-guestagain(guest again);
2008-1-9
(#4174330@0)
-
i can receive/send email by outlook express,the settings are the same. yahoo 也说没问题。“it should work”.
-volunteer(angel);
2008-1-9
(#4174352@0)
-
outlook 不也是先连接到smtp server吗?
-volunteer(angel);
2008-1-9
(#4174414@0)
-
报告你个消息,我的yahoo信箱也不行了。我有两个YAHOO信箱,一个用CLASSIC界面,一个用新界面,前者不行后者行,结果我把第二个信箱换会到CLASSIC界面后也不行了,再换回新界面也还是不行。
-tjhong(我检讨);
2008-1-9
(#4174433@0)
-
对不起,还是行的,我的两个信箱都行。不行是我忘了diable防毒软件。
今天刚注册的一个不行。
-tjhong(我检讨);
2008-1-9
(#4174452@0)
-
你的意思是你的两个yahoo 邮箱没问题,但是我的不行?并且你刚刚注册的也不行?just now i was calling yahoo after i saw your post, fortunately not connected. LOL
-volunteer(angel);
2008-1-9
(#4174478@0)
-
right
-tjhong(我检讨);
2008-1-9
(#4174628@0)
-
怪了,我用了几个yahoo email,都不行。yahoo technical support 信誓旦旦的说行。我却怎么试都不行。付费免费的都不行。
-volunteer(angel);
2008-1-9
(#4174791@0)