LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Sending email from Excel vba problem


Ron

I have just got back to this problem, and have been trying your
suggestion of using CDO.

I am working on a LAN and want everyone to be able to use the resulting
code to be able to send attachements from the Excel file back to one of
the users. We use Outlook and don't have Outlook Express set up for
users.

I started with the following code:

Sub CDO_Send_Workbook()
Dim iMsg As Object
Dim iConf As Object
Dim Flds As Variant


Application.ScreenUpdating = False


Set iMsg = CreateObject("CDO.Message")
Set iConf = CreateObject("CDO.Configuration")


iConf.Load -1 ' CDO Source Defaults

Set Flds = iConf.Fields
With Flds


..Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2


..Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") =
"our proxy server"


..Item("http://schemas.microsoft.com/cdo/configuration/smtpserverport")
= 25


..Item("http://schemas.microsoft.com/cdo/configuration/sendusername") =
"domain\username"


..Item("http://schemas.microsoft.com/cdo/configuration/sendpassword") =
"password"

..Update

End With


With iMsg
Set .Configuration = iConf
..To = "admin user email"
..From = """paul"" <my email"
..Subject = "Your Weekly Performance Files"
..TextBody = "Weekly Files"
..AddAttachment "U:\Temp\Time.xls"
..Send
End With


Set iMsg = Nothing
Set iConf = Nothing
Set wb = Nothing
Application.ScreenUpdating = True

End Sub


I put in the full domain name, and my usersname, but not sure about the
password (used my usual logon password).

It returns a run time error: "The message could not be sent to the SMTP
server. The transport error code was 0x800cc15. The server response was
not available."

I realise I am a bit out of my depth, but if there is a something
obvious I am doing wrong...

Thanks in anticipation,

Paul


--
PaulC
------------------------------------------------------------------------
PaulC's Profile: http://www.excelforum.com/member.php...fo&userid=7563
View this thread: http://www.excelforum.com/showthread...hreadid=380386

 
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
Have problem sending spreadsheet email and losing custom toolbar and macros memphoman Excel Discussion (Misc queries) 0 January 19th 06 08:40 PM
sending email from Excel nuExcel[_4_] Excel Programming 1 June 7th 04 04:24 AM
Sending email from Excel Denise Posey Excel Programming 9 February 4th 04 09:29 AM
sending email in Excel Peter W[_2_] Excel Programming 1 September 15th 03 04:13 PM
HELP sending email from Excel Memnoch Excel Programming 0 July 12th 03 02:18 PM


All times are GMT +1. The time now is 05:00 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"