Hello...
Does any1 here know how do I send an Email using the VB script?
I wanna have also the Email features: Subject, Body, Attachments.
Any Idea?
Printable View
Hello...
Does any1 here know how do I send an Email using the VB script?
I wanna have also the Email features: Subject, Body, Attachments.
Any Idea?
ASP I know but it won't work with client side scripting and only on IIS.
Code:
<%
set objEMail = Server.CreateObject("CDONTS.NewMail")
objEMail.To = "[email protected]"
objEMail.From = "[email protected]"
objEMail.Subject = "Subject text"
objEMail.Body = "Body Text"
objEMail.Send
set objEMail = nothing
%>
It doesnt work.
Guys, Any other Idea?
btw, where can I find some information about all of what I can use within the CreateObject method?
If you want to send it through Outlook it's easy.
set myOlApp = CreateObject("Outlook.Application")
set newMsg = myOlApp.CreateItem(0) 'Zero = Normal Message
newMsg.body = yourMessage
newMsg.subject = yourSubject
newMsg.Attachments.add FilePath
newMsg.recipients.add yourFriend
newMsg.send
Man...
I tried it and it is not working.
I Dont know why.
Lets say I just wanna send an Email to [email protected]
the subject would be: "Subject" , the body would be: "Body",
and the attachment would be "c:\test\test.txt"
Will the following code be OK?
This code is not working, why?Code:set myOlApp = CreateObject("Outlook.Application")
set newMsg = myOlApp.CreateItem(0) 'Zero = Normal Message
newMsg.body = "Body"
newMsg.subject = "Subject"
newMsg.Attachments.add ("c:\test\test.txt")
newMsg.recipients.add ("[email protected]")
newMsg.send
You were almost there, try the following:
set myOlApp = CreateObject("Outlook.Application")
set newMsg = myOlApp.CreateItem(0) 'Zero = Normal Message
newMsg.body = "Body"
newMsg.subject = "Subject"
newMsg.Attachments.add "c:\test\test.txt"
newMsg.recipients.add "[email protected]"
newMsg.send
That is the problem, I think. This code is for accessing Outlook not Outlook Express. I'll have to check and see if you can access Outlook Express in a similar manner.
Thanks...
I searched the whole net and didnt find a code for Outlook Express. I really hope you will.
I'm waiting for your answer.
Its really important for me.
I looked everywhere I could think of and couldn't find any code for accessing Outlook Express in this manner. Sorry.
Man...Thank you very very much!
I really appriciate your help.
Now I'm just starting to work with Microsoft Outlook and not with the Outlook Express.
With the Original Outlook (which is included with the MS Office package), The code really worked.
Thanks again,
For Everything.
Hi, I don't know anything about VBScript programming but this code looks like it would be very helpful, can ayone give me the code as it would be inserted into HTML? I know how to change the values and stuff like that, ie the subject, I just don't know how to put it in the HTML code.
You just simply put script tags around it
<script language="vbscript">
'Put code here
</script>
But where do I put the text to be clicked on?
Outlook Express does not support the MAPI. Only Outlook that is part of Microsoft Office Does.