Photo Gallery Member List Search Calendars FAQ Ticket List Log Out


Problem with sending emails with attachment

 
Logged in as: Guest
arrSession:exec spGetSession 2,17,60933
 Active Users: There are 0 members and 0 guests.
 Users viewing this topic: none
 

 

 
  
  Printable Version
All Forums >> [Scripting] >> Windows Script Components >> Problem with sending emails with attachment
  Do you like VisualBasicScript.com? Link to us and help spread the word about our forum. Thanks!
Page: [1]
Login
Message << Older Topic   Newer Topic >>
 Problem with sending emails with attachment - 6/2/2008 3:17:51 PM   
  hybc

 

Posts: 4
Score: 0
Joined: 6/2/2008
Status: offline
Hi Guys,

I got some problem sending out email with vbs. I can send email with attachment when I place the files in the root (C:\), however if I moved to any other dir, and correct the path in the script it will not work....... I have no idea why..... checked premission on folder all users have full control permission. Anyone have any idea at all??? Thanks!

Sub SendEmail()

   objMessage.Subject = "test "
   objMessage.From = "me@domain.com.au"
   objMessage.To = strEmail

   objMessage.TextBody = "test"

   objMessage.Addattachment "C:\Events.txt"  <---------- (WORKS)
   'objMessage.Addattachment "C:\HELO\Events.txt"  <------------ (Not working)

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

   objMessage.Configuration.Fields.Item _
   ("http://schemas.microsoft.com/cdo/configuration/smtpserver") = strExchComputer

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

   objMessage.Configuration.Fields.Update

   objMessage.Send

   Wscript.Echo "Email sent to " & strEmail
End Sub
 
 
Post #: 1
 
 RE: Problem with sending emails with attachment - 6/2/2008 3:44:30 PM   
  hybc

 

Posts: 4
Score: 0
Joined: 6/2/2008
Status: offline
Dont worry found the problem.... Forgot to close the file object before I attach the attachment.... haha Thanks guys

(in reply to hybc)
 
 
Post #: 2
 
 
 
  

If you found our site useful please link to us <a href="http://www.visualbasicscript.com">VisualBasicScript.com</a>.
All Forums >> [Scripting] >> Windows Script Components >> Problem with sending emails with attachment Page: [1]
Jump to:





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts