Solved

VB / CDO - How to send an EMail

Posted on 2007-03-20
3
1,082 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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
I need help formating a date variable in my VB.Net application 2 60
VBA filters 2 65
How to make an ADE file by code? 11 94
MS Access 03, TransferText, decimal places 8 78
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.
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
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…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

860 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