473,382 Members | 1,238 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,382 software developers and data experts.

Send Mail From Outlook Web Access

I've got RH9 Linux with default PHP.

Is there a way to send email on Linux to an Exchange Server from PHP
and/or other tools when there is *NOT* SMTP access?

Has anyone figured out a way to use PHP to get inside an OWA (Microsoft
Outlook Web Access) website to send email that way?

The reason I ask is because my corporate office is going to do away
with our rogue SMTP server access and force everything through Exchange
Server. This makes it hard for our batch scripts on the Linux server to
relay to internal email accounts that a job has failed or other errors.

Jul 17 '05 #1
11 12030
NC
Google Mike wrote:

Is there a way to send email on Linux to an Exchange Server
from PHP and/or other tools when there is *NOT* SMTP access?
I'm lost... If you don't have SMTP access to an Exchange Server,
is there a guarantee you can have any other kind of access?
Has anyone figured out a way to use PHP to get inside an OWA
(Microsoft Outlook Web Access) website to send email that way?
Not that I heard of, but it should be doable via cURL or
even fsockopen().
The reason I ask is because my corporate office is going
to do away with our rogue SMTP server access and force
everything through Exchange Server.


Again, Exchange Server can (and does) provide SMTP service...
Can you explain the problem in a little more detail? In
particular, are the Exchange Server and your Linux machine
on the same LAN?

Cheers,
NC

Jul 17 '05 #2
just use the address for the Exchange server as the SMTP and everything
should be fine -- I have never had an issue with it myself.

Jul 17 '05 #3

"Google Mike" <go********@hotpop.com> wrote in message
news:11**********************@l41g2000cwc.googlegr oups.com...
I've got RH9 Linux with default PHP.

Is there a way to send email on Linux to an Exchange Server from PHP
and/or other tools when there is *NOT* SMTP access?

Has anyone figured out a way to use PHP to get inside an OWA (Microsoft
Outlook Web Access) website to send email that way?

The reason I ask is because my corporate office is going to do away
with our rogue SMTP server access and force everything through Exchange
Server. This makes it hard for our batch scripts on the Linux server to
relay to internal email accounts that a job has failed or other errors.


Not something I've tried. According to Microsoft, all Exchange
functionalities are expose through XML and HTTP/DAV. So in theory, you can
send a message without SMTP.

Here's a good introductory article:

http://msdn.microsoft.com/library/de...devwebapps.asp
Jul 17 '05 #4
The answer: it's firewalled away from my access. The only port I can
reach is the Outlook to Exchange Server port and port 80 (OWA).

Jul 17 '05 #5

"Google Mike" <go********@hotpop.com> wrote in message
news:11**********************@l41g2000cwc.googlegr oups.com...
I've got RH9 Linux with default PHP.

Is there a way to send email on Linux to an Exchange Server from PHP
and/or other tools when there is *NOT* SMTP access?

Has anyone figured out a way to use PHP to get inside an OWA (Microsoft
Outlook Web Access) website to send email that way?

The reason I ask is because my corporate office is going to do away
with our rogue SMTP server access and force everything through Exchange
Server. This makes it hard for our batch scripts on the Linux server to
relay to internal email accounts that a job has failed or other errors.


Actually, it appears that OWA works with non-IE browsers. You should be able
to post a message via a regular HTTP post. My suggestion is to download a
HTTP logging tool from somewhere, and examine the transaction between
Firefox and OWA when a message is sent to see what need to be done.

If you have a relatively recent version of PHP, doing a HTTP post with
authentication info is fairly easy. Just take a look at
http://www.php.net/stream_context_create/
Jul 17 '05 #6
Yeah. I think I'll try that. You reminded me that I don't have to just
do this from Windows which has like zero tools for monitoring HTTP
traffic. I can do it from Mozilla and Linux. Duh. (Pinching myself
because I forgot about that! :) ) So, I just need to see if I can find
an HTTP logging tool for Linux. Got any suggestions?

Oh, and the good news is that my office has this enabled over HTTP, not
HTTPS, so I can actually read the traffic. They enable it over HTTP for
intranet, and HTTPS for when we're outside the office.

Jul 17 '05 #7

"Google Mike" <go********@hotpop.com> wrote in message
news:11**********************@o13g2000cwo.googlegr oups.com...
Yeah. I think I'll try that. You reminded me that I don't have to just
do this from Windows which has like zero tools for monitoring HTTP
traffic. I can do it from Mozilla and Linux. Duh. (Pinching myself
because I forgot about that! :) ) So, I just need to see if I can find
an HTTP logging tool for Linux. Got any suggestions?

Oh, and the good news is that my office has this enabled over HTTP, not
HTTPS, so I can actually read the traffic. They enable it over HTTP for
intranet, and HTTPS for when we're outside the office.


There's a Mozilla extension called livehttpheaders. I've never used it
myself, but it's probably worth a try. Just Google for it.
Jul 17 '05 #8
Thanks. Your a pal! :)

Jul 17 '05 #9
To get into OWA, I did some tests by using Linux, Mozilla (with proxy
turned on to self), and then fired up the Squid proxy for Linux. I
disabled strip_query_terms in squid.conf so that I could see the full
URL. Here's what I found in the /var/log/squid/acccess.log file after
using OWA to send a message. (Also look for my further comments below
this.)

GET http://webmail/
GET http://webmail/exchange/logon.asp
GET
http://webmail/exchange/LogonFrm.asp...Google%2C+Mike
GET
http://webmail/exchange/LogonFrm.asp...Google%2C+Mike
GET http://webmail/exchange/root.asp
GET http://webmail/exchange/Navbar/nbInbox.asp
GET http://webmail/exchange/inbox/main_f...re=0&obj=&acs=
GET
http://webmail/exchange/inbox/title....pidx=0&store=0
GET
http://webmail/exchange/inbox/peerfl...890000&store=0
GET
http://webmail/exchange/inbox/messag...890000&store=0
GET http://webmail/exchange/inbox/comman...othing&store=0
GET http://webmail/exchange/images/envelope.gif
GET
http://webmail/exchange/forms/ipm/no...nd=new&store=0
GET
http://webmail/exchange/forms/ipm/no...=1&att=0&imp=1
GET
http://webmail/exchange/forms/ipm/no...12136&caller=1
GET http://webmail/exchange/forms/ipm/no....asp?obj=12136
POST http://webmail/exchange/forms/ipm/note/commands.asp
# The above POST, if done in GET format, would probably be:
http://webmail/exchange/forms/ipm/no...1&importance=1
GET http://webmail/exchange/logoff.asp

One of the first things that happens is Basic Authentication. (Note
that NTLM Authentication is just Basic Authentication pointed at a
Active Directory or SAM security file.) That means that one has to pass
a Basic Auth header when trying to login on to LogonFrm.asp.

I think some of these URLs I might not even be required to hit in order
to acquire the proper session ID on the server or the proper cookie
information. For instance, I would reason to bet that the long HEX info
?obj= in some of the URLs above is not even a necessary page one needs
to hit in order to send out email. If it is, then perhaps one of the
prior pages passes this information.

I also think all the magic happens in commands.asp in that POST. Since
I know that often times you can replace a POST with a GET to debug
things, I believe the above replacement for the POST just might work.
Otherwise one will have to pass a form to the commands.asp.

The only cookie I received was on the webmail/logon.asp page, and it
was just an ordinary session ID. Perhaps some of the prior pages to
commands.asp updates the server's session cookie with other information
-- I don't know.

Meanwhile, watch out for the objID parameter in the URL -- that's
uniquely identified each time. I believe one of the prior pages
provides that value and this must be reused in order for the email to
go out.

Jul 17 '05 #10
After hours and hours of frustration, I got it to work! Got it started
in Linux Bash with curl. Also used Squid and Mozilla with Squid as
proxy in order to identify all the URLs.

One can easily convert the following to PHP if they know a little PHP.
They can also use the $result=`command`; to get it done that way.

This also circumvents the Microsoft security stuff that prevents one
from doing the same thing with CDO code on a Windows box.

If you all can shorten this script down from a better hack -- I'd love
to see your examples.

#!/bin/bash

# Script to connect Linux to OWA 5.5 (perhaps works with later revs)
# to send an email on behalf of some user.

# Note for some reason this won't work if you have the Outlook client
open.
# Doesn't seem to mind if OWA is open, though.

# Note you can remove some curl switches below to not have any debug
# traffic show up on your console when you run this as a test.

# Note this example assumes it's http instead of https -- change this
if
# otherwise in your environment.

DOMAIN=DISNEYWORLD
USER=mmouse
PASS=dontguessit
LASTNAME=Mouse
FIRSTNAME=Mickey
EMAIL_TO="mi**********@disneyworldland.com"
EMAIL_CC=""
EMAIL_BCC=""
EMAIL_SUBJECT='This is a test'
EMAIL_MSG='This is the test message.'

EMAIL_SUBJECT=`echo -n $EMAIL_SUBJECT | sed 's/ /%20/g'`
EMAIL_MSG=`echo -n $EMAIL_MSG | sed 's/ /%20/g'`

rm -f *.asp
rm -f *.txt

curl -y 15 -o logon.asp -c cookies.txt
http://webmail/exchange/logon.asp

# why I have to do the following twice is beyond my recognition --
might
# have to do with timing??

curl -y 15 -v -o logonfrm.asp -b cookies.txt -u $DOMAIN\\$USER:$PASS
http://webmail/exchange/LogonFrm.asp?isnewwindow=0\&mailbox=$LASTNAME%20$F IRSTNAME
curl -y 15 -v -o logonfrm.asp -b cookies.txt -u $DOMAIN\\$USER:$PASS
http://webmail/exchange/LogonFrm.asp?isnewwindow=0\&mailbox=$LASTNAME%20$F IRSTNAME

curl -y 15 -v -o root.asp -b cookies.txt -u $DOMAIN\\$USER:$PASS
http://webmail/exchange/root.asp

curl -y 15 -v -o nbinbox.asp -b cookies.txt -u $DOMAIN\\$USER:$PASS
http://webmail/exchange/Navbar/nbInbox.asp

curl -y 15 -v -o main_fr.asp -b cookies.txt -u $DOMAIN\\$USER:$PASS
'http://webmail/exchange/inbox/main_fr.asp?view=1&store=0&obj=&acs='
OBJID=$(cat main_fr.asp | grep -i "var szCurFolderID" | cut -f 4 -d " "
| cut -f 2 -d "\"" | tr -d "\n")
curl -y 15 -v -o peerfldr.asp -b cookies.txt -u $DOMAIN\\$USER:$PASS
"http://webmail/exchange/inbox/peerfldr.asp?obj=$OBJID&store=0"

curl -y 15 -v -o commands1.asp -b cookies.txt -u $DOMAIN\\$USER:$PASS
'http://webmail/exchange/inbox/commands.asp?command=nothing&store=0'

curl -y 15 -v -o messages.asp -b cookies.txt -u $DOMAIN\\$USER:$PASS
"http://webmail/exchange/inbox/messages.asp?obj=$OBJID&store=0"

curl -y 15 -v -o title.asp -b cookies.txt -u $DOMAIN\\$USER:$PASS
"http://webmail/exchange/inbox/title.asp?obj=$OBJID&acs=&compidx=0&store=0"

curl -y 15 -v -o frmroot.asp -b cookies.txt -u $DOMAIN\\$USER:$PASS
'http://webmail/exchange/forms/ipm/note/frmroot.asp?command=new&store=0'
MSGID=$(cat frmroot.asp | grep -i "+\"&obj=" | cut -f 2 -d "=" | cut -f
1 -d "\"" | tr -d "\n")

curl -y 15 -v -o cmptitle.asp -b cookies.txt -u $DOMAIN\\$USER:$PASS
'http://webmail/exchange/forms/ipm/note/cmpTitle.asp?tab=1&att=0&imp=1'

curl -y 15 -v -o cmpmsg.asp -b cookies.txt -u $DOMAIN\\$USER:$PASS
"http://webmail/exchange/forms/ipm/note/cmpMsg.asp?obj=$MSGID&caller=1"

curl -y 15 -v -o commands2.asp -b cookies.txt -u $DOMAIN\\$USER:$PASS
"http://webmail/exchange/forms/ipm/note/commands.asp?obj=$MSGID"

curl -y 15 -v -o commands3.asp -b cookies.txt -u $DOMAIN\\$USER:$PASS
-d
"to=$EMAIL_TO&cc=$EMAIL_CC&bcc=$EMAIL_BCC&subject= $EMAIL_SUBJECT&message=$EMAIL_MSG&tab=message&comm and=send&objID=$MSGID&savecopy=1&importance=1"
"http://webmail/exchange/forms/ipm/note/commands.asp"

curl -y 15 -v -o logoff.asp -b cookies.txt -u "$DOMAIN\\$USER:$PASS"
'http://webmail/exchange/logoff.asp'

Jul 17 '05 #11
An even better version...

#!/usr/bin/bash

# filename: send2owa

# send2owa -- Send Message From Linux To Exchange Server Via Outlook
Web Access

# Public Domain

# The anonymous author designed this so that Linux-based business
system batch job status reports could be sent to Outlook clients in a
corporate environment where SMTP was banned and Exchange Server was the
only thing enabled.

# /note/ This is programmed for Exchange 5.5 -- may need mods for other
revs of OWA. If you need to modify, consider using Squid with query
params turned on and point your browser to this proxy. That way, you
can see the web server interaction of GETs and POSTs and can tweak this
script per your needs.

# Note Microsoft calls itself interoperable but this API below is not
explained
# and they want you to go through the even more convoluted WebDAV
technique. Note how interoperable Linux is!

# Note that you can't use CDO API in VB anymore without all these
security alerts popping up, leaving us with no choice but to go this
route!

# Possible improvement suggestion -- build a fake SMTP service in your
favorite Linux language that then uses send2owa to send the message to
the Exchange server. This permits you to use ordinary SMTP tools with
your corporate development and operations teams in order to send mail
out.

if [ "$1" == "-i" ]; then
INTERACTIVE="TRUE"
fi
if [ "$1" == "-h" ]; then
NEEDSHELP="TRUE"
fi
if [ "$1" == "--help" ]; then
NEEDSHELP="TRUE"
fi
if [ "$1" == "-?" ]; then
NEEDSHELP="TRUE"
fi
if [ "$1" == "/?" ]; then
NEEDSHELP="TRUE"
fi
if [ "$1" == "" ]; then
NEEDSHELP="TRUE"
fi
if [ $NEEDSHELP ]; then
echo -e "send2owa $VERSION: Send Message From Linux To Outlook\n"
echo -e "Usage: send2owa [-i | {strict options order}]\n"
echo -e "\t-i =\t\t\t Interactive. Prompts you for everything."
echo -e "\t{strict options order} = Non-interactive. Requires options
in following order."
echo -e "\n\tNote: \"Quoting\" your options is REQUIRED.\n"
echo -e "\t\t<Your Outlook Webmail Host Name>"
echo -e "\t\t<Your Domain>"
echo -e "\t\t<Your Username>"
echo -e "\t\t<Your Password>"
echo -e "\t\t<Your First Name>"
echo -e "\t\t<Your Last Name>"
echo -e "\t\t<Your Recipient Email Address List (Semicolon Delimited)>"
echo -e "\t\t<Your CC Email Address List (Ditto)>"
echo -e "\t\t<Your BCC Email Address List (Ditto)>"
echo -e "\t\t<Email Subject>"
echo -e "\t\t<Email Message>\n"
echo -e "Ex:\n"
echo -e "./send2owa 'webmail' 'rook' 'jsmith' 'Pass1' 'Jack' 'Smith'
'd*****@gadgets.bv' '' '' 'Hello, World!' 'This is a test.'\n"
exit
fi

rm -f inbox_id.html
rm -f msg_id.html
rm -f sent_result.html
rm -f cookies.txt

if [ $INTERACTIVE ]; then
echo -e "\nsend2owa $VERSION: Send Message From Linux To Outlook\n\n"
read -p "Your Outlook Webmail Host Name: " OWAHOST
read -p "Your Domain: " DOMAIN
read -p "Your Username: " USER
echo -en "Your Password: "
read -rs PASS
echo ""
read -p "Your First Name: " FIRSTNAME
read -p "Your Last Name: " LASTNAME
read -p "Recipient Email Address List (Semicolon Delimited): " EMAIL_TO
read -p "[OPTIONAL] CC Email Address List (Semicolon Delimited): "
EMAIL_CC
read -p "[OPTIONAL] BCC Email Address List (Semicolon Delimited): "
EMAIL_BCC
read -r -p "Email Subject: " EMAIL_SUBJECT
read -r -p "Email Message: " EMAIL_MSG
else
OWAHOST=$1
DOMAIN=$2
USER=$3
PASS=$4
FIRSTNAME=$5
LASTNAME=$6
EMAIL_TO=$7
EMAIL_CC=$8
EMAIL_BCC=$9
EMAIL_SUBJECT=${10}
EMAIL_MSG=${11}
fi

echo -e "\nLogging in to Outlook Webmail Server \"$OWAHOST\" ..."

# LOGIN TO MAIL SERVER. NOTE FIRST TIME YOU DO THIS WE GRAB AN ERROR
AND A VALID ASP SESSION COOKIE. THIS WAS THE ONLY WAY I COULD GET IN.
# NEXT, IT USES THIS SESSION COOKIE ON ALL SUBSEQUENT PAGES. I HAD TO
RETRIEVE logonfrm.asp TWICE BECAUSE OF I THINK MICROSOFT HAS TO TAKE
# TIME ON IIS TO BUILD A SESSION OBJECT FOR US?? OH WELL -- WHATEVER
WORKS

curl -y 15 -c cookies.txt -u $DOMAIN\\$USER:$PASS
"http://$OWAHOST/exchange/LogonFrm.asp?isnewwindow=0&mailbox=$LASTNAME%20$FI RSTNAME"
/dev/nul 2>&1
curl -y 15 -b cookies.txt -u $DOMAIN\\$USER:$PASS
"http://$OWAHOST/exchange/LogonFrm.asp?isnewwindow=0&mailbox=$LASTNAME%20$FI RSTNAME" /dev/nul 2>&1
echo -e "Sending Message \"$EMAIL_SUBJECT\" ..."

# CHEAP URLENCODING WITHOUT DOWNLOADING EXTRA TOOLS!

EMAIL_SUBJECT=`echo -n $EMAIL_SUBJECT | sed 's/ /%20/g'`
EMAIL_SUBJECT=`echo -n $EMAIL_SUBJECT | sed 's/?/%3F/g'`
EMAIL_SUBJECT=`echo -n $EMAIL_SUBJECT | sed 's/\`/%60/g'`
EMAIL_SUBJECT=`echo -n $EMAIL_SUBJECT | sed 's/~/%7E/g'`
EMAIL_SUBJECT=`echo -n $EMAIL_SUBJECT | sed 's/!/%21/g'`
EMAIL_SUBJECT=`echo -n $EMAIL_SUBJECT | sed 's/@/%40/g'`
EMAIL_SUBJECT=`echo -n $EMAIL_SUBJECT | sed 's/#/%23/g'`
EMAIL_SUBJECT=`echo -n $EMAIL_SUBJECT | sed 's/&/%26/g'`
EMAIL_SUBJECT=`echo -n $EMAIL_SUBJECT | sed 's/*/%2A/g'`
EMAIL_SUBJECT=`echo -n $EMAIL_SUBJECT | sed 's/(/%28/g'`
EMAIL_SUBJECT=`echo -n $EMAIL_SUBJECT | sed 's/)/%29/g'`
EMAIL_SUBJECT=`echo -n $EMAIL_SUBJECT | sed 's/+/%2B/g'`
EMAIL_SUBJECT=`echo -n $EMAIL_SUBJECT | sed 's/=/%3D/g'`
EMAIL_SUBJECT=`echo -n $EMAIL_SUBJECT | sed 's/{/%7B/g'`
EMAIL_SUBJECT=`echo -n $EMAIL_SUBJECT | sed 's/}/%7D/g'`
EMAIL_SUBJECT=`echo -n $EMAIL_SUBJECT | sed 's/|/%7C/g'`
EMAIL_SUBJECT=`echo -n $EMAIL_SUBJECT | sed 's/\[/%5B/g'`
EMAIL_SUBJECT=`echo -n $EMAIL_SUBJECT | sed 's/]/%5D/g'`
EMAIL_SUBJECT=`echo -n $EMAIL_SUBJECT | sed 's/\\\\/%5C/g'`
EMAIL_SUBJECT=`echo -n $EMAIL_SUBJECT | sed 's/:/%3A/g'`
EMAIL_SUBJECT=`echo -n $EMAIL_SUBJECT | sed 's/;/%3B/g'`
EMAIL_SUBJECT=`echo -n $EMAIL_SUBJECT | sed 's/"/%22/g'`
EMAIL_SUBJECT=`echo -n $EMAIL_SUBJECT | sed "s/'/%27/g"`
EMAIL_SUBJECT=`echo -n $EMAIL_SUBJECT | sed 's/</%3C/g'`
EMAIL_SUBJECT=`echo -n $EMAIL_SUBJECT | sed 's/>/%3E/g'`
EMAIL_SUBJECT=`echo -n $EMAIL_SUBJECT | sed 's/\//%2F/g'`
EMAIL_SUBJECT=`echo -n $EMAIL_SUBJECT | sed 's/,/%2C/g'`

EMAIL_MSG=`echo -n $EMAIL_MSG | sed 's/ /%20/g'`
EMAIL_MSG=`echo -n $EMAIL_MSG | sed 's/?/%3F/g'`
EMAIL_MSG=`echo -n $EMAIL_MSG | sed 's/\`/%60/g'`
EMAIL_MSG=`echo -n $EMAIL_MSG | sed 's/~/%7E/g'`
EMAIL_MSG=`echo -n $EMAIL_MSG | sed 's/!/%21/g'`
EMAIL_MSG=`echo -n $EMAIL_MSG | sed 's/@/%40/g'`
EMAIL_MSG=`echo -n $EMAIL_MSG | sed 's/#/%23/g'`
EMAIL_MSG=`echo -n $EMAIL_MSG | sed 's/&/%26/g'`
EMAIL_MSG=`echo -n $EMAIL_MSG | sed 's/*/%2A/g'`
EMAIL_MSG=`echo -n $EMAIL_MSG | sed 's/(/%28/g'`
EMAIL_MSG=`echo -n $EMAIL_MSG | sed 's/)/%29/g'`
EMAIL_MSG=`echo -n $EMAIL_MSG | sed 's/+/%2B/g'`
EMAIL_MSG=`echo -n $EMAIL_MSG | sed 's/=/%3D/g'`
EMAIL_MSG=`echo -n $EMAIL_MSG | sed 's/{/%7B/g'`
EMAIL_MSG=`echo -n $EMAIL_MSG | sed 's/}/%7D/g'`
EMAIL_MSG=`echo -n $EMAIL_MSG | sed 's/|/%7C/g'`
EMAIL_MSG=`echo -n $EMAIL_MSG | sed 's/\[/%5B/g'`
EMAIL_MSG=`echo -n $EMAIL_MSG | sed 's/]/%5D/g'`
EMAIL_MSG=`echo -n $EMAIL_MSG | sed 's/\\\\/%5C/g'`
EMAIL_MSG=`echo -n $EMAIL_MSG | sed 's/:/%3A/g'`
EMAIL_MSG=`echo -n $EMAIL_MSG | sed 's/;/%3B/g'`
EMAIL_MSG=`echo -n $EMAIL_MSG | sed 's/"/%22/g'`
EMAIL_MSG=`echo -n $EMAIL_MSG | sed "s/'/%27/g"`
EMAIL_MSG=`echo -n $EMAIL_MSG | sed 's/</%3C/g'`
EMAIL_MSG=`echo -n $EMAIL_MSG | sed 's/>/%3E/g'`
EMAIL_MSG=`echo -n $EMAIL_MSG | sed 's/\//%2F/g'`
EMAIL_MSG=`echo -n $EMAIL_MSG | sed 's/,/%2C/g'`
# NOW WE HIT main_fr.asp TO GET A LONG INBOX ID FOR USE IN SUBSEQUENT
PAGES

curl -y 15 -o inbox_id.html -b cookies.txt -u $DOMAIN\\$USER:$PASS
"http://$OWAHOST/exchange/inbox/main_fr.asp?view=1&store=0&obj=&acs=" >
/dev/nul 2>&1
INBOXID=$(cat inbox_id.html | grep -i "var szCurFolderID" | cut -f 4 -d
" " | cut -f 2 -d "\"" | tr -d "\n")

# NOW WE HIT frmroot.asp SO THAT IT ALLOCATES A FRESH MESSAGE OBJECT
FOR US FOR THIS INBOX AND GIVES US A
# FRESH MESSAGE OBJECT ID.

curl -y 15 -o msg_id.html -b cookies.txt -u $DOMAIN\\$USER:$PASS
"http://$OWAHOST/exchange/forms/ipm/note/frmroot.asp?command=new&store=0" /dev/nul 2>&1

MSGID=$(cat msg_id.html | grep -i "+\"&obj=" | cut -f 2 -d "=" | cut -f
1 -d "\"" | tr -d "\n")

# NOW WE POST OUR EMAIL FORM DATA TO
/exchange/forms/ipm/note/commands.asp TO SEND THE MESSAGE OUT

curl -y 15 -o sent_result.html -b cookies.txt -u $DOMAIN\\$USER:$PASS
-d
"to=$EMAIL_TO&cc=$EMAIL_CC&bcc=$EMAIL_BCC&subject= $EMAIL_SUBJECT&message=$EMAIL_MSG&tab=message&comm and=send&objID=$MSGID&savecopy=1&importance=1"
"http://$OWAHOST/exchange/forms/ipm/note/commands.asp" > /dev/nul 2>&1

# NOW WE PLAY NICE AND FREE UP SERVER RESOURCES BY LOGGING OFF

curl -y 15 -b cookies.txt -u "$DOMAIN\\$USER:$PASS"
"http://$OWAHOST/exchange/logoff.asp" > /dev/nul 2>&1

if [ `cat sent_result.html | grep -i "command=holding"` ]; then
echo -e "\n\tMail SENT\n\n"
else
echo -e "\n\tMail NOT sent!!! Try debugging send2owa script.\n\n"
fi

# FOR DEBUG -- COMMENT THE PAGES OUT BELOW SO THAT YOU CAN READ THE
CONTENT TO DETERMINE PROBLEMS
rm -f inbox_id.html
rm -f msg_id.html
rm -f sent_result.html
rm -f cookies.txt

Jul 17 '05 #12

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

Similar topics

0
by: David Burson | last post by:
Hi, I have a VB.NET windows app that needs to automatically send a simple text email when my users run a new version of the app for the first time. I thought this would be simple, but after...
2
by: Ronny Sigo | last post by:
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...
3
by: Carlos Lozano | last post by:
Hi, I know I can create e-mails and send them using System.Web.Mail, but I was wondering how can I do it using the POP3 settings on Office Outlook or Outlook Express. The problem I have is some...
0
by: Erwan | last post by:
I have a strange (but very blocking) result when using the smtpmail class from an ASPX page : here is the (very simple !) code... '-------------------------------------------------- mail.To =...
10
by: Mike Charney | last post by:
Is there a simple way to send SMTP email from Access VBA? Mike m charney at dunlap hospital dot org
1
by: Mr T | last post by:
I know how to send email from Access and I know how to create a custom form in Outlook. but.... How do I put the email info from Access into the Outlook custom form ??? Dim MyDB As Database Dim...
17
by: rdemyan | last post by:
My app creates a building report. My users have requested that I provide functionality to e-mail these "building reports" to building managers once a month. So assuming that I have the...
16
by: Kosmos | last post by:
Good afternoon everyone, just wondering if anyone knew if it's possible to send meetings or appointments through email when you run VBA or SQL code in Access 2003? The following is the code I've been...
5
by: pat | last post by:
Hi, i'am using an ac2K progrom which sends automaticle emails with an attachment. Since last week , a error occurs with number 2293. Our mail program is Outlook 2003. It's probably a matter...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
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
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...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

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.