Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9
Default send a mail from VBA / excel

hi all,

how can i send a mail from excel using VBA.

that is, i have a program in excel (VBA) and at the end i obtain a
text file with the results.

i need to send a simple mail (TO:, SUBJECT: ) with this text info as
body of the mail.

i would like when i "click" my program, at the end it send this mail

tks in advance

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 120
Default send a mail from VBA / excel

Have a look at this website

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

hth

Keith

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9
Default send a mail from VBA / excel

keith,

tks, nice!

i already tested and works ok writting the mail in the outlook outbox!

BUT, i have a problem, i am not used outlook, but mozilla firefox, so
i need to access to mozilla outbox, or connect directly to email
server (?????)

sorry i didn't explain complete in my first post :-(

any ideas?

tks in advance.

On May 31, 12:27 pm, Keith74 wrote:
http://www.rondebruin.nl/sendmail.htm



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 120
Default send a mail from VBA / excel

sry, can't help here, no expereience of that at all

did find this after a quick search on the net

http://www.paulsadowski.com/WSH/cdo.htm


  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9
Default send a mail from VBA / excel

On May 31, 1:01 pm, Keith74 wrote:
http://www.paulsadowski.com/WSH/cdo.htm



keith, tks a lot!!!!!

that page shows how to use MS CDO

- i enabled its reference, and worked fine with the simple example

Sub Mail1()
Set objMessage = CreateObject("CDO.Message")
objMessage.Subject = "Example CDO Message"
objMessage.From = "
objMessage.To = "
objMessage.TextBody = "This is some sample message text."

'==This section provides the configuration information for the remote
SMTP server.
'==Normally you will only change the server name or IP.

objMessage.Configuration.Fields.item _
("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2

'Name or IP of Remote SMTP Server
objMessage.Configuration.Fields.item _
("http://schemas.microsoft.com/cdo/configuration/smtpserver") _
= "smtp.toto.com"

'Server port (typically 25)
objMessage.Configuration.Fields.item _
("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25

objMessage.Configuration.Fields.Update

'==End remote SMTP server configuration section==

objMessage.Send

End Sub



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,302
Default send a mail from VBA / excel

Hi RH,

Yo have solved your problem now, but you couuld
have used Ron de Bruin's CDO page at the site
originally suggested by Keith:


Sending mail from Excel with CDO
http://www.rondebruin.nl/cdo.htm



---
Regards,
Norman



"rhXX" wrote in message
oups.com...
On May 31, 1:01 pm, Keith74 wrote:
http://www.paulsadowski.com/WSH/cdo.htm



keith, tks a lot!!!!!

that page shows how to use MS CDO

- i enabled its reference, and worked fine with the simple example

Sub Mail1()
Set objMessage = CreateObject("CDO.Message")
objMessage.Subject = "Example CDO Message"
objMessage.From = "
objMessage.To = "
objMessage.TextBody = "This is some sample message text."

'==This section provides the configuration information for the remote
SMTP server.
'==Normally you will only change the server name or IP.

objMessage.Configuration.Fields.item _
("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2

'Name or IP of Remote SMTP Server
objMessage.Configuration.Fields.item _
("http://schemas.microsoft.com/cdo/configuration/smtpserver") _
= "smtp.toto.com"

'Server port (typically 25)
objMessage.Configuration.Fields.item _
("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25

objMessage.Configuration.Fields.Update

'==End remote SMTP server configuration section==

objMessage.Send

End Sub



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
Bypass: A program is trying to send mail using Item.Send prompt Vick Excel Discussion (Misc queries) 1 June 25th 09 03:31 AM
A program is trying to send mail using Item.Send David Gerstman Excel Programming 4 December 5th 06 06:31 PM
Send web mail from Excel (VBA)?? MaxS Excel Programming 11 July 31st 06 10:06 AM
how to send mail with excel vba EXCEL$B!!(BNEWS Excel Programming 4 April 6th 06 11:08 AM
how to send e-mail from excel Barmaley Excel Programming 3 August 22nd 03 04:26 PM


All times are GMT +1. The time now is 11:14 AM.

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"