×

Loading...
Ad by
  • 予人玫瑰,手有余香:加拿大新天地工作移民诚聘求职顾问&行业导师!
Ad by
  • 予人玫瑰,手有余香:加拿大新天地工作移民诚聘求职顾问&行业导师!

Does anybody knows how to send email by using VB?

i have tried using the "Microsft CDO for NTS 1.2 Liberary". But an error message came out and the program stopped at the sentence "****.send".

the message is
" Run-time error '-2147023836(80070424)';
Method 'Send of object 'INewMail' failed "

My program is

Private Sub Form_Load()
Dim aa As CDONTS.NewMail
Set aa = New CDONTS.NewMail
aa.Subject = "sdfasdf"
aa.To = "nsu@thsdfsdf.ca"
aa.Body = "AAAAA"
aa.Send
End Sub

The OS of my PC is windwos2000 professional(SP2).
The mail software is microsoft outlook and the server is exchange.

thanks
Report

Replies, comments and Discussions:

  • 枫下家园 / 电脑用户 / Does anybody knows how to send email by using VB?
    i have tried using the "Microsft CDO for NTS 1.2 Liberary". But an error message came out and the program stopped at the sentence "****.send".

    the message is
    " Run-time error '-2147023836(80070424)';
    Method 'Send of object 'INewMail' failed "

    My program is

    Private Sub Form_Load()
    Dim aa As CDONTS.NewMail
    Set aa = New CDONTS.NewMail
    aa.Subject = "sdfasdf"
    aa.To = "nsu@thsdfsdf.ca"
    aa.Body = "AAAAA"
    aa.Send
    End Sub

    The OS of my PC is windwos2000 professional(SP2).
    The mail software is microsoft outlook and the server is exchange.

    thanks
    • I used VB to send email too. no propblem. we use smtp
    • run you SMTP server first.
      • could u explain in details? thanks
        • just open control panel , ---services--smtp start, then you can use it
          • my computer is restricted from this service, but i do know the smtp server ip, And then how can i do with it? thanks
          • before you do that, make sure IIS was started
            • sorry, this service is restricted too
              • 你以什么身份登录的?
                • of course i can''t use the administrator accoount, i only use my own account
                  • 你是给自己网站做的吗? 好象是必须用管理员身份登陆才能启动服务什么的。 你不是要发垃圾邮件吧。
                    • I went to the exchange server and found there was no smtp service running, but the Exchange IMS service. The service situation is ok in the microsoft document for CDONTS
          • hi, when i open control panel, but didn't find services. can you make it more clear? thank you very much!
            • control panel---administrator tool--serverices
    • check your email,please.
    • if i run this program on the server side, it is ok! why? Can anyone tell me the reason?
      • can you give me the detail
        • what kind of detail do u want to know?
          • some = oceandeep = xdyun999 ???
            • something wrong, but any question?
      • sign, did you mean before you runit locally? should run on mail server.
        • no, the program runs correctly on the server side, but can't not run on the client side
          • my case is that asp calls a business object ruuning on the mail server. If you run the application on client's side, you should call it from mail server. am i right?
            • i don't think so. you can just sent *.eml to the mailserver and the server knows how to deal with it
              • you mean you creat *.eml files on clinet's side and send to the server? I am afraid it need administrator privilege. well, I only used groupwise and smtp to implement this function. perhpas you have more experience.
                • no,i have no experience at all. i just think you can send a *.eml to a specialized directory.
                  • oh, my expereince is you can drop .eml file to the directory, and the email server pick it up and send it out automatically. but it is not good for programmering email. I like SMTP, becasue no sender address validation.
                    • but now i have no smtp, only exchange IMS
                      • doesn't matter. you can use exchange dll in your vb application like my groupwise (novell).
                        • Sorry, i knew little about Vb, so i will have a try according to what u said, Thank you very much anyway
                          • you are welcome.
      • I guess the problem is you don't have smtp of IIS installed on your ws. Since CDONTS needs either Exchange server or SMTP Service under IIS. My w2000 professional has SMTP and IIS installed. It works fine
        • Actually, it did not send out the message since I did not connect to Internet. Since I was online then I got the message sent from App.
        • Yes, The server has no SMTP but it do has run the Micorsoft Exchange IMS service