below is a script to send mail but i want to run the script from context menu "right click" and use file on which i have right clicked as attachment
if i had to run cmd command i can use %1 as right clicked filename but how to do same with this vbscript???
Set objMail = CreateObject("CDO.Message")
Set objConf = CreateObject("CDO.Configuration")
Set objFlds = objConf.Fields
'Set various parameters and properties of CDO object
objFlds.Item("http://schemas.microsoft.com/cdo/configuration/sendusing Jump ") = 2 'cdoSendUsingPort
'your smtp server domain or IP address goes here such as smtp.yourdomain.com
objFlds.Item("http://schemas.microsoft.com/cdo/configuration/smtpserver Jump ") = "smtp.mail.yahoo.com"
objFlds.Item("http://schemas.microsoft.com/cdo/configuration/smtpserverport Jump ") = 25 'default port for email
'uncomment next three lines if you need to use SMTP Authorization
'objFlds.Item("http://schemas.microsoft.com/cdo/configuration/sendusername Jump ") = "your-username"
'objFlds.Item("http://schemas.microsoft.com/cdo/configuration/sendpassword Jump ") = "your-password"
'objFlds.Item("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate Jump ") = 1 'cdoBasic
objFlds.Update
objMail.Configuration = objConf
objMail.From = "fromEmailAddress@yourdomain.com"
objMail.To = "toEmailAddress@yourdomain.com"
objMail.Subject = "Put your email's subject line here"
objMail.TextBody = "Your email body content goes here"
Attach = WScript.Arguments(0)
objMail.AddAttachment Attach 'Don't use = after AddAttachment, just provide the path
objMail.Send
'Set all objects to nothing after sending the email
Set objFlds = Nothing
Set objConf = Nothing
Set objMail = Nothing
Registry Location :
Computer\HKEY_CLASSES_ROOT*\shell\Mail
Computer\HKEY_CLASSES_ROOT*\shell\Mail\command
c:\Windows\System32\mail.vbs "%1"
Email Sent MsgBox is displayed. But Mail is not being sent. Can someone try and help.