Sybase NNTP forums - End Of Life (EOL)

The NNTP forums from Sybase - forums.sybase.com - are now closed.

All new questions should be directed to the appropriate forum at the SAP Community Network (SCN).

Individual products have links to the respective forums on SCN, or you can go to SCN and search for your product in the search box (upper right corner) to find your specific developer center.

Mail class object problem.

4 posts in ,  General Discussion Objects Last posting was on 2005-09-01 07:58:47.0Z
Doros Mylonas Posted on 2005-08-31 05:41:51.0Z
Reply-To: "Doros Mylonas" <dmylonas@riskmatrixirms.com>
From: "Doros Mylonas" <dmylonas@riskmatrixirms.com>
Newsgroups: sybase.public.powerbuilder.general,sybase.public.powerbuilder.objects
Subject: Mail class object problem.
Lines: 71
Organization: RiskMatrix Ltd
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.2180
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180
X-RFC2646: Format=Flowed; Original
X-Original-NNTP-Posting-Host: adsl-161-145.cytanet.com.cy
Message-ID: <43154319@forums-2-dub>
X-Original-Trace: 30 Aug 2005 22:41:45 -0700, adsl-161-145.cytanet.com.cy
X-Original-NNTP-Posting-Host: forums-2-dub.sybase.com
X-Original-Trace: 30 Aug 2005 22:41:48 -0700, forums-2-dub.sybase.com
NNTP-Posting-Host: forums-master.sybase.com
X-Original-NNTP-Posting-Host: forums-master.sybase.com
Date: 30 Aug 2005 22:41:51 -0700
X-Trace: forums-1-dub 1125466911 10.22.108.75 (30 Aug 2005 22:41:51 -0700)
X-Original-Trace: 30 Aug 2005 22:41:51 -0700, forums-master.sybase.com
X-Authenticated-User: ngsysop
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.powerbuilder.general:185420 sybase.public.powerbuilder.objects:8562
Article PK: 636737

Hi all,

I have developed an interface program using PB 7 that pipes data from one
database into another and generates a log file that includes all possible
errors.

The interface is working fine and now I want to write a code that will use
the PB mail objects to send the log file to administrators via the email
client software.

I have followed the examples given in the PB help and PB examples and
managed to send emails successfully. However, I'm having the following two
problems that I need you help.


1. When I attach the log file on the email message the Mail.Send function
returns a Failure error and I can't figure out what's the cause.

Here is the script:

mailSession mSes
mailReturnCode mRet
mailMessage mMsg

// Create a mail session
mSes = create mailSession

// Log on to the session
mRet = mSes.mailLogon(mailNewSession!)
IF mRet <> mailReturnSuccess! THEN
MessageBox("Mail", 'Logon failed.')
RETURN
END IF
DateTime sys_datetime
sys_datetime = DateTime(Today(), Now())

// Populate the mailMessage structure
mMsg.Subject = "MRA ICAP Link: New Update Run on:" +
String(sys_datetime,"dd-mm-yyyy hh:mm:ss;'none'")
mMsg.NoteText = 'Please find attached the MRA ICAP link Log file.'
mMsg.Recipient[1].name = 'dmylonas@riskmatrixirms.com'

// Request a receipt from Recipient
mMsg.ReceiptRequested = true

//// Attach a file
mMsg.AttachmentFile[1].FileType = mailAttach!
mMsg.AttachmentFile[1].PathName = 'C:\'
mMsg.AttachmentFile[1].FileName = "IcapLink.log"
mMsg.AttachmentFile[1].Position = len(mMsg.notetext) - 1


// Send the mail
mRet = mSes.mailSend(mMsg)

mSes.mailLogoff()
DESTROY mSes

2. If I use the script above without attaching the log file the message is
send to the recipient successfully. However, after I press the Send Button
and the above script is executed I get an extra window (I'm assuming my
email client software OE 6 does that) asking a permission from the user to
send the email or to abort.

My question is how to disable this window from popping up?

You quick response will be greatly appreciated.

Doros


"Richard Coleman" Posted on 2005-08-31 16:59:43.0Z
From: "Richard Coleman" <Richard Coleman at DRE DOT CA DOT GOV>
Newsgroups: sybase.public.powerbuilder.general,sybase.public.powerbuilder.objects
References: <43154319@forums-2-dub>
Subject: Re: Mail class object problem.
Lines: 89
Organization: Dept of Real Estate
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1506
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1506
NNTP-Posting-Host: 165.235.56.85
X-Original-NNTP-Posting-Host: 165.235.56.85
Message-ID: <4315e1ff$1@forums-1-dub>
Date: 31 Aug 2005 09:59:43 -0700
X-Trace: forums-1-dub 1125507583 165.235.56.85 (31 Aug 2005 09:59:43 -0700)
X-Original-Trace: 31 Aug 2005 09:59:43 -0700, 165.235.56.85
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.powerbuilder.general:185446 sybase.public.powerbuilder.objects:8566
Article PK: 636766

You need to adjust your setting up of the attachment. The documentation is
not very well written on this. From experience, try:

mMsg.AttachmentFile[1].FileType = mailAttach!
mMsg.AttachmentFile[1].PathName = 'C:\IcapLink.log'
mMsg.AttachmentFile[1].FileName = 'C:\IcapLink.log'
mMsg.AttachmentFile[1].Position = -1

The popup is definitely an MS Outlook issue. I remember that somewhere on
the forum, a reference was made to a little
utility that could disable it. Search the forum for the link.

Richard

"Doros Mylonas" <dmylonas@riskmatrixirms.com> wrote in message
news:43154319@forums-2-dub...
> Hi all,
>
> I have developed an interface program using PB 7 that pipes data from one
> database into another and generates a log file that includes all possible
> errors.
>
> The interface is working fine and now I want to write a code that will use
> the PB mail objects to send the log file to administrators via the email
> client software.
>
> I have followed the examples given in the PB help and PB examples and
> managed to send emails successfully. However, I'm having the following two
> problems that I need you help.
>
>
> 1. When I attach the log file on the email message the Mail.Send function
> returns a Failure error and I can't figure out what's the cause.
>
> Here is the script:
>
> mailSession mSes
> mailReturnCode mRet
> mailMessage mMsg
>
> // Create a mail session
> mSes = create mailSession
>
> // Log on to the session
> mRet = mSes.mailLogon(mailNewSession!)
> IF mRet <> mailReturnSuccess! THEN
> MessageBox("Mail", 'Logon failed.')
> RETURN
> END IF
> DateTime sys_datetime
> sys_datetime = DateTime(Today(), Now())
>
> // Populate the mailMessage structure
> mMsg.Subject = "MRA ICAP Link: New Update Run on:" +
> String(sys_datetime,"dd-mm-yyyy hh:mm:ss;'none'")
> mMsg.NoteText = 'Please find attached the MRA ICAP link Log file.'
> mMsg.Recipient[1].name = 'dmylonas@riskmatrixirms.com'
>
> // Request a receipt from Recipient
> mMsg.ReceiptRequested = true
>
> //// Attach a file
> mMsg.AttachmentFile[1].FileType = mailAttach!
> mMsg.AttachmentFile[1].PathName = 'C:\'
> mMsg.AttachmentFile[1].FileName = "IcapLink.log"
> mMsg.AttachmentFile[1].Position = len(mMsg.notetext) - 1
>
>
> // Send the mail
> mRet = mSes.mailSend(mMsg)
>
> mSes.mailLogoff()
> DESTROY mSes
>
> 2. If I use the script above without attaching the log file the message is
> send to the recipient successfully. However, after I press the Send Button
> and the above script is executed I get an extra window (I'm assuming my
> email client software OE 6 does that) asking a permission from the user to
> send the email or to abort.
>
> My question is how to disable this window from popping up?
>
> You quick response will be greatly appreciated.
>
> Doros
>
>


Chris Pollach Posted on 2005-08-31 17:46:18.0Z
From: "Chris Pollach" <cpollach@travel-net.dot.com>
Newsgroups: sybase.public.powerbuilder.general,sybase.public.powerbuilder.objects
References: <43154319@forums-2-dub> <4315e1ff$1@forums-1-dub>
Subject: Re: Mail class object problem.
Lines: 111
Organization: STD Inc.
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 5.50.4927.1200
X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4927.1200
NNTP-Posting-Host: stealth.nserc.ca
X-Original-NNTP-Posting-Host: stealth.nserc.ca
Message-ID: <4315ecea$1@forums-1-dub>
Date: 31 Aug 2005 10:46:18 -0700
X-Trace: forums-1-dub 1125510378 198.96.2.93 (31 Aug 2005 10:46:18 -0700)
X-Original-Trace: 31 Aug 2005 10:46:18 -0700, stealth.nserc.ca
X-Authenticated-User: pb105beta
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.powerbuilder.general:185447 sybase.public.powerbuilder.objects:8567
Article PK: 636767

Rick;

Yes, that would be: "ClickYes".
Have a look at: http://www.contextmagic.com/express-clickyes - it works
great for me!

Regards ....Chris

"Richard Coleman" <Richard Coleman at DRE DOT CA DOT GOV> wrote in message
news:4315e1ff$1@forums-1-dub...
> You need to adjust your setting up of the attachment. The documentation
is
> not very well written on this. From experience, try:
>
> mMsg.AttachmentFile[1].FileType = mailAttach!
> mMsg.AttachmentFile[1].PathName = 'C:\IcapLink.log'
> mMsg.AttachmentFile[1].FileName = 'C:\IcapLink.log'
> mMsg.AttachmentFile[1].Position = -1
>
> The popup is definitely an MS Outlook issue. I remember that somewhere on
> the forum, a reference was made to a little
> utility that could disable it. Search the forum for the link.
>
> Richard
>
> "Doros Mylonas" <dmylonas@riskmatrixirms.com> wrote in message
> news:43154319@forums-2-dub...
> > Hi all,
> >
> > I have developed an interface program using PB 7 that pipes data from
one
> > database into another and generates a log file that includes all
possible
> > errors.
> >
> > The interface is working fine and now I want to write a code that will
use
> > the PB mail objects to send the log file to administrators via the email
> > client software.
> >
> > I have followed the examples given in the PB help and PB examples and
> > managed to send emails successfully. However, I'm having the following
two
> > problems that I need you help.
> >
> >
> > 1. When I attach the log file on the email message the Mail.Send
function
> > returns a Failure error and I can't figure out what's the cause.
> >
> > Here is the script:
> >
> > mailSession mSes
> > mailReturnCode mRet
> > mailMessage mMsg
> >
> > // Create a mail session
> > mSes = create mailSession
> >
> > // Log on to the session
> > mRet = mSes.mailLogon(mailNewSession!)
> > IF mRet <> mailReturnSuccess! THEN
> > MessageBox("Mail", 'Logon failed.')
> > RETURN
> > END IF
> > DateTime sys_datetime
> > sys_datetime = DateTime(Today(), Now())
> >
> > // Populate the mailMessage structure
> > mMsg.Subject = "MRA ICAP Link: New Update Run on:" +
> > String(sys_datetime,"dd-mm-yyyy hh:mm:ss;'none'")
> > mMsg.NoteText = 'Please find attached the MRA ICAP link Log file.'
> > mMsg.Recipient[1].name = 'dmylonas@riskmatrixirms.com'
> >
> > // Request a receipt from Recipient
> > mMsg.ReceiptRequested = true
> >
> > //// Attach a file
> > mMsg.AttachmentFile[1].FileType = mailAttach!
> > mMsg.AttachmentFile[1].PathName = 'C:\'
> > mMsg.AttachmentFile[1].FileName = "IcapLink.log"
> > mMsg.AttachmentFile[1].Position = len(mMsg.notetext) - 1
> >
> >
> > // Send the mail
> > mRet = mSes.mailSend(mMsg)
> >
> > mSes.mailLogoff()
> > DESTROY mSes
> >
> > 2. If I use the script above without attaching the log file the message
is
> > send to the recipient successfully. However, after I press the Send
Button
> > and the above script is executed I get an extra window (I'm assuming my
> > email client software OE 6 does that) asking a permission from the user
to
> > send the email or to abort.
> >
> > My question is how to disable this window from popping up?
> >
> > You quick response will be greatly appreciated.
> >
> > Doros
> >
> >
>
>


Doros Mylonas Posted on 2005-09-01 07:58:47.0Z
Reply-To: "Doros Mylonas" <dmylonas@riskmatrixirms.com>
From: "Doros Mylonas" <dmylonas@riskmatrixirms.com>
Newsgroups: sybase.public.powerbuilder.general,sybase.public.powerbuilder.objects
References: <43154319@forums-2-dub> <4315e1ff$1@forums-1-dub> <4315ecea$1@forums-1-dub>
Subject: Re: Mail class object problem.
Lines: 122
Organization: RiskMatrix Ltd
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.2180
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180
X-RFC2646: Format=Flowed; Original
X-Original-NNTP-Posting-Host: adsl-163-233.cytanet.com.cy
Message-ID: <4316b4b3@forums-2-dub>
X-Original-Trace: 1 Sep 2005 00:58:43 -0700, adsl-163-233.cytanet.com.cy
X-Original-NNTP-Posting-Host: forums-2-dub.sybase.com
X-Original-Trace: 1 Sep 2005 00:58:44 -0700, forums-2-dub.sybase.com
NNTP-Posting-Host: forums-master.sybase.com
X-Original-NNTP-Posting-Host: forums-master.sybase.com
Date: 1 Sep 2005 00:58:47 -0700
X-Trace: forums-1-dub 1125561527 10.22.108.75 (1 Sep 2005 00:58:47 -0700)
X-Original-Trace: 1 Sep 2005 00:58:47 -0700, forums-master.sybase.com
X-Authenticated-User: ngsysop
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.powerbuilder.general:185469 sybase.public.powerbuilder.objects:8569
Article PK: 636788

Thank you guys. Both suggestions work perfectly.

Doros

"Chris Pollach" <cpollach@travel-net.dot.com> wrote in message
news:4315ecea$1@forums-1-dub...
> Rick;
>
> Yes, that would be: "ClickYes".
> Have a look at: http://www.contextmagic.com/express-clickyes - it works
> great for me!
>
> Regards ....Chris
>
>
> "Richard Coleman" <Richard Coleman at DRE DOT CA DOT GOV> wrote in message
> news:4315e1ff$1@forums-1-dub...
>> You need to adjust your setting up of the attachment. The documentation
> is
>> not very well written on this. From experience, try:
>>
>> mMsg.AttachmentFile[1].FileType = mailAttach!
>> mMsg.AttachmentFile[1].PathName = 'C:\IcapLink.log'
>> mMsg.AttachmentFile[1].FileName = 'C:\IcapLink.log'
>> mMsg.AttachmentFile[1].Position = -1
>>
>> The popup is definitely an MS Outlook issue. I remember that somewhere
>> on
>> the forum, a reference was made to a little
>> utility that could disable it. Search the forum for the link.
>>
>> Richard
>>
>> "Doros Mylonas" <dmylonas@riskmatrixirms.com> wrote in message
>> news:43154319@forums-2-dub...
>> > Hi all,
>> >
>> > I have developed an interface program using PB 7 that pipes data from
> one
>> > database into another and generates a log file that includes all
> possible
>> > errors.
>> >
>> > The interface is working fine and now I want to write a code that will
> use
>> > the PB mail objects to send the log file to administrators via the
>> > email
>> > client software.
>> >
>> > I have followed the examples given in the PB help and PB examples and
>> > managed to send emails successfully. However, I'm having the following
> two
>> > problems that I need you help.
>> >
>> >
>> > 1. When I attach the log file on the email message the Mail.Send
> function
>> > returns a Failure error and I can't figure out what's the cause.
>> >
>> > Here is the script:
>> >
>> > mailSession mSes
>> > mailReturnCode mRet
>> > mailMessage mMsg
>> >
>> > // Create a mail session
>> > mSes = create mailSession
>> >
>> > // Log on to the session
>> > mRet = mSes.mailLogon(mailNewSession!)
>> > IF mRet <> mailReturnSuccess! THEN
>> > MessageBox("Mail", 'Logon failed.')
>> > RETURN
>> > END IF
>> > DateTime sys_datetime
>> > sys_datetime = DateTime(Today(), Now())
>> >
>> > // Populate the mailMessage structure
>> > mMsg.Subject = "MRA ICAP Link: New Update Run on:" +
>> > String(sys_datetime,"dd-mm-yyyy hh:mm:ss;'none'")
>> > mMsg.NoteText = 'Please find attached the MRA ICAP link Log file.'
>> > mMsg.Recipient[1].name = 'dmylonas@riskmatrixirms.com'
>> >
>> > // Request a receipt from Recipient
>> > mMsg.ReceiptRequested = true
>> >
>> > //// Attach a file
>> > mMsg.AttachmentFile[1].FileType = mailAttach!
>> > mMsg.AttachmentFile[1].PathName = 'C:\'
>> > mMsg.AttachmentFile[1].FileName = "IcapLink.log"
>> > mMsg.AttachmentFile[1].Position = len(mMsg.notetext) - 1
>> >
>> >
>> > // Send the mail
>> > mRet = mSes.mailSend(mMsg)
>> >
>> > mSes.mailLogoff()
>> > DESTROY mSes
>> >
>> > 2. If I use the script above without attaching the log file the message
> is
>> > send to the recipient successfully. However, after I press the Send
> Button
>> > and the above script is executed I get an extra window (I'm assuming my
>> > email client software OE 6 does that) asking a permission from the user
> to
>> > send the email or to abort.
>> >
>> > My question is how to disable this window from popping up?
>> >
>> > You quick response will be greatly appreciated.
>> >
>> > Doros
>> >
>> >
>>
>>
>
>