PDA

View Full Version : email issue



Hanna Philippi
15-Apr-2005, 05:19 PM
guys,

I have the following code that works fine within my asp page.I need to have
it working within mt .wbo as I want to generate and send an email in the
procedure body in a web report.how can I do that and is this possible

thks

Set myMail=CreateObject("CDO.Message")
myMail.Subject="Po#:"+iorder
myMail.From=
myMail.To=
myMail.TextBody=inotes
myMail.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/sendusing")=2
'Name or IP of remote SMTP server
myMail.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/smtpserver") _
="192.168.0.7"
'Server port
myMail.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/smtpserverport") _
=25
myMail.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") _
=1
myMail.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/sendusername") _
=
myMail.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/sendpassword") _
=
myMail.Configuration.Fields.Update


myMail.Send

Nick Wright
16-Apr-2005, 08:39 AM
Hanna,

I'm not sure exactly what you mean but a couple of solutions come to mind.

If you mean you wish to email someone as each record is found in the body
procedure of your report then ie. at the same time as the html is written,
then you need to call a method within your wbo that can generate an email
such as using an smtp ocx, or call another program passing parameters that
can do that for you.

or
If you mean displayed on the client webpage on each report line you want a
link such as - Click to Order - then when they click it, it sends an email;
then you would do the following:

let's say you asp page was myorder.asp

in your wbo add the link column with something like:-
Move ("myorder.asp?po=" + string(yourfile.Order_Number)) to sRef
send writehtml ('<td><a href=' + sRef + '">Click to Order</a></td>')

then in your asp page

iorder=request("po")
snotes=mywbo.call ("get_ponotes",iorder)

you then have enough information from the GET to complete the cdo message as
below.

You could also add a button in a form instead of GETting information you
could create a hidden input then POST the data.

hope this helps,


Nick


"Hanna Philippi" <hphilippi@icecorp.ca> wrote in message
news:DwKN7kgQFHA.3672@dacmail.dataaccess.com...
> guys,
>
> I have the following code that works fine within my asp page.I need to
> have it working within mt .wbo as I want to generate and send an email in
> the procedure body in a web report.how can I do that and is this possible
>
> thks
>
> Set myMail=CreateObject("CDO.Message")
> myMail.Subject="Po#:"+iorder
> myMail.From=
> myMail.To=
> myMail.TextBody=inotes
> myMail.Configuration.Fields.Item _
> ("http://schemas.microsoft.com/cdo/configuration/sendusing")=2
> 'Name or IP of remote SMTP server
> myMail.Configuration.Fields.Item _
> ("http://schemas.microsoft.com/cdo/configuration/smtpserver") _
> ="192.168.0.7"
> 'Server port
> myMail.Configuration.Fields.Item _
> ("http://schemas.microsoft.com/cdo/configuration/smtpserverport") _
> =25
> myMail.Configuration.Fields.Item _
> ("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") _
> =1
> myMail.Configuration.Fields.Item _
> ("http://schemas.microsoft.com/cdo/configuration/sendusername") _
> =
> myMail.Configuration.Fields.Item _
> ("http://schemas.microsoft.com/cdo/configuration/sendpassword") _
> =
> myMail.Configuration.Fields.Update
>
>
> myMail.Send
>