473,385 Members | 1,764 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Code to send mail ..

Hello all,
I a struggling for a few days now to find a way to send automated mail. I
succeeded except that MS Outlook always gives me those 2 stupid warnings
that 1) a "program tries to get access
to the emailadresses in the contactlist - and wether I want to allow this"
and 2) That a program is trying to send emails on my behalf - and wether I
want to allow this. ... I have tried to use the redemption package but
obviously I do not understand enough of it ..
I was thinking of making Outlook Express the default email prog - so maybe
that one does not give me those warnings;
Does anyone have an old code he would like to share that would send a set of
variables (mailadress, subject, body ...) to the default e-mail prog. (Thus
in this case Outlook Express)
Any help very much appreciated ...
Thanks
Ronny Sigo

Nov 12 '05 #1
2 9582
"Ronny Sigo" <ro********@example.invalid> wrote in
news:3f***********************@reader1.news.skynet .be:
Hello all,
I a struggling for a few days now to find a way to send automated mail.
I succeeded except that MS Outlook always gives me those 2 stupid
warnings that 1) a "program tries to get access
to the emailadresses in the contactlist - and wether I want to allow
this" and 2) That a program is trying to send emails on my behalf - and
wether I want to allow this. ... I have tried to use the redemption
package but obviously I do not understand enough of it ..
I was thinking of making Outlook Express the default email prog - so
maybe that one does not give me those warnings;
Does anyone have an old code he would like to share that would send a
set of variables (mailadress, subject, body ...) to the default e-mail
prog. (Thus in this case Outlook Express)
Any help very much appreciated ...
Thanks
Ronny Sigo


IMO using an interactive e-mail client such as Outlook Express or that
resident in Outlook is inefficient. (I've written procedures doing so, but
not since I first worked with CDO.)

If your OS is Win 2000 or greater then CDO may be the solution for your
problem. A description of CDO can be found at:
<http://msdn.microsoft.com/library/de...n-us/dncdsys/h
tml/cdo_roadmap.asp>

This is a JScript manifestation of CDO code. (Sorry, I have some in VBA
but it’s lost in the archives, somewhere).

var iCfg=new ActiveXObject('CDO.Configuration');
var iMsg=new ActiveXObject('CDO.Message');

iCfg.Fields.Item('http://schemas.microsoft.com/cdo/configuration/sendusing'
)=2;
iCfg.Fields.Item('http://schemas.microsoft.com/cdo/configuration/smtpserver
port')=25;
iCfg.Fields.Item('http://schemas.microsoft.com/cdo/configuration/smtpserver
')='your smtp server';
iCfg.Fields.Item('http://schemas.microsoft.com/cdo/configuration/smtpauthen
ticate')=1;
iCfg.Fields.Item('http://schemas.microsoft.com/cdo/configuration/senduserna
me')='your user name';
iCfg.Fields.Item('http://schemas.microsoft.com/cdo/configuration/sendpasswo
rd')='your password'; iCfg.Fields.Update();

iMsg.Configuration=iCfg;

iMsg.From='your email address';
iMsg.Subject='Test';
iMsg.TextBody='This is Lyle\'s JScript code';
iMsg.TextBody+='\n\n\Rename extension to "jse" to make "runnable".';
iMsg.AddAttachment('f:/WindowsScripts/email.txt');
iMsg.To='e\-mail address of recipient';
iMsg.Send();
--
Lyle
(for e-mail refer to http://ffdba.com/contacts.htm)
Nov 12 '05 #2
Thanks for responding Lyle
I managed, with only one problem left. See next post if you like
Greetings :)
"Lyle Fairfield" <Mi************@Invalid.Com> wrote in message
news:Xn*******************@130.133.1.4...
"Ronny Sigo" <ro********@example.invalid> wrote in
news:3f***********************@reader1.news.skynet .be:
Hello all,
I a struggling for a few days now to find a way to send automated mail.
I succeeded except that MS Outlook always gives me those 2 stupid
warnings that 1) a "program tries to get access
to the emailadresses in the contactlist - and wether I want to allow
this" and 2) That a program is trying to send emails on my behalf - and
wether I want to allow this. ... I have tried to use the redemption
package but obviously I do not understand enough of it ..
I was thinking of making Outlook Express the default email prog - so
maybe that one does not give me those warnings;
Does anyone have an old code he would like to share that would send a
set of variables (mailadress, subject, body ...) to the default e-mail
prog. (Thus in this case Outlook Express)
Any help very much appreciated ...
Thanks
Ronny Sigo
IMO using an interactive e-mail client such as Outlook Express or that
resident in Outlook is inefficient. (I've written procedures doing so, but
not since I first worked with CDO.)

If your OS is Win 2000 or greater then CDO may be the solution for your
problem. A description of CDO can be found at:

<http://msdn.microsoft.com/library/de...n-us/dncdsys/h tml/cdo_roadmap.asp>

This is a JScript manifestation of CDO code. (Sorry, I have some in VBA
but it's lost in the archives, somewhere).

var iCfg=new ActiveXObject('CDO.Configuration');
var iMsg=new ActiveXObject('CDO.Message');

iCfg.Fields.Item('http://schemas.microsoft.com/cdo/configuration/sendusing' )=2;
iCfg.Fields.Item('http://schemas.microsoft.com/cdo/configuration/smtpserver port')=25;
iCfg.Fields.Item('http://schemas.microsoft.com/cdo/configuration/smtpserver ')='your smtp server';
iCfg.Fields.Item('http://schemas.microsoft.com/cdo/configuration/smtpauthen ticate')=1;
iCfg.Fields.Item('http://schemas.microsoft.com/cdo/configuration/senduserna me')='your user name';
iCfg.Fields.Item('http://schemas.microsoft.com/cdo/configuration/sendpasswo rd')='your password'; iCfg.Fields.Update();

iMsg.Configuration=iCfg;

iMsg.From='your email address';
iMsg.Subject='Test';
iMsg.TextBody='This is Lyle\'s JScript code';
iMsg.TextBody+='\n\n\Rename extension to "jse" to make "runnable".';
iMsg.AddAttachment('f:/WindowsScripts/email.txt');
iMsg.To='e\-mail address of recipient';
iMsg.Send();
--
Lyle
(for e-mail refer to http://ffdba.com/contacts.htm)

Nov 12 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: Rajani | last post by:
Hello, dim receiptto receiptto="a2z@yahoo.com" set cdoconfig=CreateObject("CDO.configuration") set cdomsg=CreateObject("CDO.Message") with cdoconfig.Fields...
1
by: chhawchharia | last post by:
i have applied this code from tutorials php of this site but its now working can i know why? Sending E-Mail with PHP By Blair Ireland Senior Editor, TheScripts.com Ok, time to teach you...
2
by: Janna Deegan | last post by:
Hello all, First off, if there is a better place to post for an answer to this question, please feel free to point me there. I have some very strange behavior happening with my System.web.mail...
12
by: Joe_Black | last post by:
Hi all, I have googled this and found some answers but none that give me exactly what I'm after, maybe someone here can help. I have an app that will be distributed to users for their laptop...
10
by: Dennis | last post by:
I am trying to send an e-mail using one of the examples I got on this group as follows: (both toemail and myemail are valid e-mail addreses. 'System.Web.Mail' (requires reference to...
2
by: Cimento Cola | last post by:
Hello all. Hope anyone can help me! I have this form, with: Please choose your file: (browse) The main purpose is the user to select a local file and then when he submits a mail should be...
0
by: .spider | last post by:
Hi, I have a code here (taken from http://www.dotnetwatch.com/page294.aspx). Now i didn't think there was anything wrong with this code(no compilation errors..nothing)..and infact when i ran this...
2
by: .spider | last post by:
Hi, This code emails the contents of 'TextBox1' and 'TextBox3' to rcv@domain.com.. this code seemed to be working fine in debug mode and DID mail rcv@domain.com However when i uploaded the website...
0
ankur30884
by: ankur30884 | last post by:
Hi Friends I am again hear with a small problem, help im trying to send a mail to extranl e-mail using Asp.net code i try use system.net.Mail system.net namespace to send mail but...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.