我正在尝试制作一个可以发送邮件的程序,但是当我试图发送邮件时,它只是提示我需要解决此问题:
COM异常类未注册(HRESULT的异常: 0x80040154(REGDB_E_CLASSNOTREG))
这是我的代码:
Outlook.Application app = new Outlook.Application();
Outlook.MailItem mailItem = app.CreateItem(Outlook.OlItemType.olMailItem);
mailItem.Subject = "Password recovery";
mailItem.To = MailTxt.Text;
mailItem.HTMLBody = "Your new password is: " + RecoveryNewPW + ". <br/> If you want to change the password, you need to do following:<ul><li>Login and go to settings tab.</li><li>Write old password in the first textbox.</li><li>Write the new password in the second textbox</li><li>Write the new password again in the third textbox</li><li>Done!</li></ul>";
mailItem.Send();
MessageBox.Show("Sent!");
非常感谢您的帮助!我知道这个问题确实存在于此站点上,但是我无法通过其他问题解决该问题。