Solved

VB / CDO - How to send an EMail

Posted on 2007-03-20
3
1,077 Views
Last Modified: 2013-11-26
Using CDO 1.2.1 how can we programmatically create and send a mail which uses an Outlook Custom Form stored in the Organizational Forms library ?
0
Comment
Question by:Madmarlin
3 Comments
 
LVL 14

Expert Comment

by:raja_ind82
Comment Utility
0
 
LVL 11

Expert Comment

by:Louis01
Comment Utility
I don;t know how you can use outlook stationary, but here is how you can create and send an email with a HTML Body:

Set objCDOSYSMail = Server.CreateObject("CDO.Message")
            Set objCDOSYSCon = Server.CreateObject ("CDO.Configuration")

            'Authenticate if necessary
            'objCDOSYSCon.Fields("http://schemas.microsoft.com/cdo/configuration/sendusername") = smtpServerName
            'objCDOSYSCon.Fields("http://schemas.microsoft.com/cdo/configuration/sendpassword") = smtpPassword
           
            'Outgoing SMTP server configuration      
            objCDOSYSCon.Fields("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "sendmail.brinkster.com"
            objCDOSYSCon.Fields("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25
            objCDOSYSCon.Fields("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2 'cdoSendUsingPort
            objCDOSYSCon.Fields("http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout") = 60
            objCDOSYSCon.Fields.Update

            'Update the CDOSYS Configuration
            Set objCDOSYSMail.Configuration = objCDOSYSCon
            objCDOSYSMail.From = "validaddress@thisdomain.com" 'This has to be valid on the selected SMTP server
strHTML = "<table class='h'><tr><td class='l'></td><td>" & _
                 "<li><a href='abc'>Open Questions</a> (0)</li>" & _
                 "<li><a href='xyz'>Question History</a> (1)</li>" & _
                 "</td></tr></table>"
            objCDOSYSMail.To = "validaddress@validdomain.com"
            objCDOSYSMail.Subject = strSubject
            objCDOSYSMail.HTMLBody = strHTML
            objCDOSYSMail.Send
0
 
LVL 1

Accepted Solution

by:
Madmarlin earned 0 total points
Comment Utility
I manage to find the answer myself..
(Quite simple afterall)

Outbox.Messages.Add(Type="IPM.Note.MyFormName")

Question now closed.
Thanks Madmarlin
0

Featured Post

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

Introduction I needed to skip over some file processing within a For...Next loop in some old production code and wished that VB (classic) had a statement that would drop down to the end of the current iteration, bypassing the statements that were c…
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…

728 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now