VB6 application to send Mail without Outlook

Is there a way to make a VB6 application send a mail without relying on Outlook.  I would like source code rather than components as I can't download freeware onto a production server.  I have something like this which works in ASP, but if you have something better please let me know.

Dim iMsg,objSendMail
Dim iConf
Dim Flds
Dim strNotes
Dim strSmartHost

Const cdoSendUsingPort = 1
StrSmartHost = "XXX"

Set objSendMail = CreateObject("CDO.Message")
set iConf = CreateObject("CDO.Configuration")
Set Flds = iConf.Fields
 'set the CDOSYS configuration fields to use port 25 on the SMTP server
With Flds
.Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = cdoSendUsingPort
.Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = strSmartHost
.Item("http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout") = 10
.Update
End With
strnotes = strnotes & "<font color= red>" & "Project_Area: " & request.Form("Department")  & "<BR>"
strnotes = strnotes & "Other_Department: " & request.Form("Other_Department") & "<BR>"
strnotes = strnotes & "area: " & request.Form("area ")& "<BR>"
With objSendMail
    .From = "aa"
    .To = "BB"            
    .Subject = Request.Form("Subject") & " - " & Request.Form("Project_Title")
    .HTMLBody = strnotes
    .Send
End With
AlHal2Asked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Éric MoreauSenior .Net ConsultantCommented:
check http://www.freevbcode.com/ShowCode.Asp?ID=109

because you have all source code, you can embed it directly into your application (even if I wouldn't).
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
AlHal2Author Commented:
Why wouldn't you embed it directly?
What I really mean to ask is whether you feel it's safe.
0
Éric MoreauSenior .Net ConsultantCommented:
I prefer to keep it as a separate DLL that is easily re-usable accross different projects.

Also if you modify it, you recompile it, you re-deploy it and all your applications have access to the newer version.
0
AlHal2Author Commented:
Thanks.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic Classic

From novice to tech pro — start learning today.