Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 15
Default Send an email message from my website using VBA code

I have an excel file on my website that customers can open to receive
activation numbers. After the VBA code gives the activation number, I need
the VBA code to send an email to my address. Can someone show me sample VBA
code to open a new email, add the address, Subject, and message and send the
message. Any help would greatly appreciated.
--
Larry
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,565
Default Send an email message from my website using VBA code

Ron has a section on his web site that deals with email.

http://www.rondebruin.nl/tips.htm


"Larry" wrote in message
...
I have an excel file on my website that customers can open to receive
activation numbers. After the VBA code gives the activation number, I
need
the VBA code to send an email to my address. Can someone show me sample
VBA
code to open a new email, add the address, Subject, and message and send
the
message. Any help would greatly appreciated.
--
Larry



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 15
Default Send an email message from my website using VBA code

Thank you for giving me the website. On Ron's website I found the VBA code
as shown below. I added it to my excel file with the changes so to write the
information I need to the email.

QUESTION: The excel file will be on my website and the VBA code requires
OUTLOOK.
Will every customer who enters my website need OUTLOOK before the VBA code
can send me an email?
What change to the VBA code do I need to make so it will work on the website.
Thank you very much for your help.
See sample code below.

Sub Mail_small_Text_Outlook()
' Is working in Office 2000-2007
Dim OutApp As Object
Dim OutMail As Object
Dim strbody As String

Set OutApp = CreateObject("Outlook.Application")
OutApp.Session.Logon
Set OutMail = OutApp.CreateItem(0)

Customer1= cells(2,3)
Date1=cells(2,4)

strbody = "Customer " & Customer1 & "received their activation code " &
Date1

On Error Resume Next
With OutMail
.To = "
.CC = ""
.BCC = ""
.Subject = "This is the Subject line"
.Body = strbody
.Display 'or use .Send
End With
On Error GoTo 0

Set OutMail = Nothing
Set OutApp = Nothing
End Sub
--
Larry


"JLGWhiz" wrote:

Ron has a section on his web site that deals with email.

http://www.rondebruin.nl/tips.htm


"Larry" wrote in message
...
I have an excel file on my website that customers can open to receive
activation numbers. After the VBA code gives the activation number, I
need
the VBA code to send an email to my address. Can someone show me sample
VBA
code to open a new email, add the address, Subject, and message and send
the
message. Any help would greatly appreciated.
--
Larry




Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
can,t send any email..get an error message telessor Excel Programming 0 January 13th 08 10:11 PM
Send spreadsheet as email message dan Excel Discussion (Misc queries) 4 September 8th 06 10:20 PM
need macro for create new email message and send it [email protected] Excel Programming 4 July 11th 06 11:15 AM
send email message Sam Excel Programming 1 August 10th 04 10:54 PM
Send email with alert message Grey Excel Programming 11 May 23rd 04 12:41 PM


All times are GMT +1. The time now is 12:16 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"