Solved

VB / CDO - How to send an EMail

Posted on 2007-03-20
3
1,081 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
ID: 18754930
0
 
LVL 11

Expert Comment

by:Louis01
ID: 18756372
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
ID: 18756862
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

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
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…

813 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

17 Experts available now in Live!

Get 1:1 Help Now