Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Default mail app.

73 views
Skip to first unread message

Ash

unread,
Feb 5, 2005, 4:23:20 PM2/5/05
to
Hello everyone !

Apart from "sendmail" which tries to send a mail from within matlab -
is they any way by which i can invoke a mail application to send an
email to a particular address ?

For example - if i have a list of mail id's, each need to recieve
information pertaining to their data set, i would like to call say -
"ms outlook" for each such recipient. That way, i can get - say 5
messages in my outbox and then do a cumulative send.

Awaiting a response..

thanks everyone!

-Ash

Michael Robbins

unread,
Feb 5, 2005, 4:36:18 PM2/5/05
to

You can take control of your mail program, i.e. Outlook, using
ActiveX, or if you want to dig a little deeper, perl or Java.

You can also use the tcpip toolbox by Peter Rydesater:

<http://petrydpc.itm.mh.se/tools> and check

StephenLL

unread,
Feb 5, 2005, 4:57:28 PM2/5/05
to
Ash wrote:
[Wants to control Outlook from Matlab]

Here is how I do it with Outlook and ActiveX in Matlab:

outlook = actxserver('Outlook.Application');

email = outlook.CreateItem('olMailitem');

% Repeat for each address
email.Recipients.Add('sup...@mathworks.com');

email.Subject = 'Test Subject';
email.Body = 'Text for body';

%email.Attachments.Add(Attach);

% For read receipt
email.ReadReceiptRequested = true

email.Send
outlook.release

--
Stephen

Ash

unread,
Feb 6, 2005, 10:45:57 AM2/6/05
to
Both solutions were excellent...

YAHOOOOOOOOOOOOO ! ! ! !

Now they shall come flocking..... Eyenheheheh heehehehe !!

thanks guys,

-Ash

Yogesh

unread,
Feb 6, 2005, 12:49:24 PM2/6/05
to
Stephen,

From where can i learn this ActiveX? I want to be able to write my
own codes like the one you have listed.

Your code looks very self explanatory but from where can I get all
these commands?

Sincerely,
Yogesh

StephenLL

unread,
Feb 6, 2005, 2:20:41 PM2/6/05
to
Yogesh wrote:
[snip, where can i learn activex?]

I rarely use activex anymore. Before I used matlab for my everyday
work I was forced to use the microsoft office application suite. VBA
is the language that is included in all(most) ms office apps. I used
the microsoft developer network part of microsoft's site for most of
my information. Here is the link: <http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnanchor/html/odc_ancoffsol.asp>

You can also do a search on the internet looking for code to control
(insert your favorite app) with vba. Using the documentation on
activex that is included with matlab you should be able to convert
the vba to matlab code pretty easily.

A short list of activeX code that we have easily converted:
* Send mail via outlook
* Get a list of today's appointments in outlook
* Connect to ODBC to return data from a database
* Get a list of named ranges in an excel workbook. (FEX)

Stephen

Steve Amphlett

unread,
Feb 6, 2005, 3:45:12 PM2/6/05
to
StephenLL wrote:
>
>
> Ash wrote:
> [Wants to control Outlook from Matlab]

[off topic)

It really saddens me the way most people think that Micro$oft
invented email (and the internet and the world wide web and usenet
for that matter). Why bother writing programs to talk to MS email
clients, why not just write your own email clients?

StephenLL

unread,
Feb 6, 2005, 4:51:05 PM2/6/05
to
Steve Amphlett wrote:
>
[Snip, Why bother writing programs to talk to MS email
> clients, why not just write your own email clients? ]

I was using the internet since gopher was the main way to get info.
So I agree with Steve's comments that most people look at MS as the
inventor of the internet. But I tend to believe that matlab users
have greater intelligence and common sense. So if they are asking to
control Outlook it must be for a good reason. :)

If you work for a company that has firewalls in place and the only
way to send email is through outlook, isn't controlling outlook
through matlab the obvious choice if you want to automate sending
some emails. I have to think that the majority of nonacademic users
are subject to these firewalls.

Another obvious reason: ( Time it takes to write own email client )
> ( Time is takes to write a few line of matlab code to control
outlook ) for us mortals.

I believe that many software developers tend to forget that most
internet users are behind firewalls 40 hrs / week. I personally
don't like MS media player, rather use winamp, but the radio through
media player is my only option when I'm in the office.

Stephen
No longer stuck behind a corporate firewall now that I work from
home. :) Now I control the firewall.

Alex H

unread,
Mar 21, 2005, 11:54:54 PM3/21/05
to
Dudes!

I've only just discovered sending email from MATLAB - brilliant
function.

Now for the question - is there a corresponding mail checking
function? Yes I know I could spend the time to write one - but that
wouldn't be in the spirit of the community if I was to overlook a
predecesors hard work.

On a slightly different subject, is there a way to 'trigger' a
function in MATLAB remotely? Eg I've set up a program to take a
snapshot of my study at home using my webcam then email it to my work
email account - is there a way I can trigger this function at any
random time remotely? I was thinking that if MATLAB could check my
home email account, I could send it an email, and if it had a certain
subject line it could perform the task. I have seen references to
other remote access programs on these forums but if a MATLAB function
exists rather than installing extra software it would be a better
solution.

Thanks for your response!

carles maria

unread,
May 2, 2005, 5:27:31 AM5/2/05
to
hi all,

i have tried StephenLL way of controlling outlook and with me is not
working. I get this error message:

??? Error: Type mismatch, argument 1.

Error in ==> C:\Documents and
Settings\Zurit001\Desktop\control_outlook.m
On line 7 ==> email = outlook.CreateItem('olMailItem');

any idea of what could be the problem?
Thanks,
carles

PS: i have MATLAB 6.5 R13 and outlook 2003

ulrik

unread,
May 4, 2005, 5:50:06 AM5/4/05
to
Try this

outlook = actxserver('Outlook.Application');

email = outlook.CreateItem(0);


% Repeat for each address
email.Recipients.Add('ma...@mail.com');


email.Subject = 'Test Subject';
email.Body = 'Text for body';

%email.Attachments.Add(Attach);

% For read receipt
email.ReadReceiptRequested = true

email.Send
outlook.release

carles maria

unread,
May 4, 2005, 10:13:25 AM5/4/05
to
hi ulrik,

this is working fine. thanks!!
however, now i have an annoying windows coming from outlook and
asking for permission to send the email

"A program is trying to access your Address Book or Contacts. Viruses
can spread by sending copies of e-mail messages to people listed in
your Address Book. You must allow or deny access to your Address Book
before this program can continue."

and then i have to click YES, but i just wanted to use this function
to send emails after the simulation is done and at that time i will
not be in front of the pc to click yes.
do you know any way to overcome this problem?

thanks

Carles

Ash

unread,
Jun 2, 2005, 1:18:24 PM6/2/05
to
Hello there...

The way i solved this problem for my purpose is by installing a free
add-in for Outlook. What you are experience is the "security
feature". I would post the exact link to where you can find it, but i
am not sure that is a good idea. So you could do a google search for

Outlook Security add in.

One more thing, if you are using a Anti-virus, you may want to
disable the script stopper. Use your discretion. The Email script
stopper will also bug you later :-)

Hope this helps.

-A

0 new messages