Sending an email through VB6

后端 未结 4 1578
广开言路
广开言路 2021-01-23 04:18

I am wondering if there is a way to send an email (SMTP) through VB6. I have an application that just needs to send a simple email when the user is done to let a group know that

4条回答
  •  甜味超标
    2021-01-23 04:56

    Dave has a good solution if you really need to send email from the client's PC. However, sometimes you get into trouble with firewalls and such. In the case where you are connecting to a SQL Server, I have found it is simpler and easier to manage if you proxy your mail through SQL Server (either by queuing it into an outgoing mail table, or calling the xp_sendmail stored proc itself).

    Here is a tutorial on how to get SQL Mail setup and working on the server, and at the end it shows how to use a stored procedure to send an email.

    I found this solution to be advantageous because:

    • Windows 7 computers were blocking all outbound SMTP
    • Implementing all the retries and such to do outbound email "right" was quite complicated
    • Using the queue method with SQL Server, but not actually setting up SQL Mail on my development or test databases, the emails stayed in the queue unless I was running against the production server

提交回复
热议问题