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.

MAPI (mailReturnFailure!)

3 posts in Objects Last posting was on 2002-11-05 20:47:14.0Z
jking Posted on 2002-11-01 17:07:27.0Z
Newsgroups: sybase.public.powerbuilder.objects
Reply-To: "jking" <kingjd@phdnswc.navy.mil>
From: "jking" <kingjd@phdnswc.navy.mil>
Subject: MAPI (mailReturnFailure!)
Date: Fri, 1 Nov 2002 09:07:27 -0800
Lines: 38
X-Newsreader: Microsoft Outlook Express 5.50.4807.1700
X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4807.1700
NNTP-Posting-Host: TITAN.PHDNSWC.NAVY.MIL 137.24.128.98
Message-ID: <364_ZTasUtcgCHA.296@forums.sybase.com>
Path: forums-1-dub!forums-1-dub!forums-master.sybase.com!forums.sybase.com
Xref: forums-1-dub sybase.public.powerbuilder.objects:816
Article PK: 713384

I get a mailReturnFailure! when executing the code below. I am running
PB8.01 Build 9056 my Mail client is MSOutLook 2000 (9.0.0.2711) [Microsoft
Exchange Server]. What am I doing wrong?

Thanks,
Jking


//
mailsession lms_MAPISession
mailmessage lmm_Message

lms_MAPISession = CREATE mailsession
IF lms_MAPISession.MailLogon() = MailReturnSuccess! THEN
// Mail Sesion is ok so Populate the Message
lmm_Message.Subject = 'Email Test' //sle_subject.text
lmm_Message.NoteText = 'Another fine day in paradise.' // mle_body.text
lmm_Message.Recipient[ 1 ].Name = 'kingjd@phdnswc.navy.mil'
//sle_to.text
lmm_Message.Recipient[ 2 ].Name = 'speedbump92@yahoo.com' // sle_cc.text

choose case lms_MAPISession.MailSend( lmm_Message )
case MailReturnSuccess!
Messagebox( 'Mail', 'Message was sent.' )
case mailReturnFailure!
Messagebox( 'Mail', 'mailReturnFailure' )
// <snipped >
case else
Messagebox( 'Mail', 'Other return code' )
end choose

lms_MAPISession.MailLogoff()
END IF

DESTROY lms_MAPISession


Andy Turiansky [TeamSybase] Posted on 2002-11-03 15:48:52.0Z
Newsgroups: sybase.public.powerbuilder.objects
Reply-To: "Andy Turiansky [TeamSybase]" <NOSPAM@aturiansky@comcast.net>
From: "Andy Turiansky [TeamSybase]" <aturiansky@comcast.net>
Subject: Re: MAPI (mailReturnFailure!)
Date: Sun, 3 Nov 2002 10:48:52 -0500
Lines: 64
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1106
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106
NNTP-Posting-Host: pcp02145427pcs.kenets01.pa.comcast.net 68.82.176.120
Message-ID: <364_COvKlK1gCHA.196@forums.sybase.com>
References: <364_ZTasUtcgCHA.296@forums.sybase.com>
Path: forums-1-dub!forums-1-dub!forums-master.sybase.com!forums.sybase.com
Xref: forums-1-dub sybase.public.powerbuilder.objects:808
Article PK: 713375

It looks like you are missing the setting of the address to send to. You
are only setting the display name. See the following snippet:


mMsg.Recipient[1].Address = "xxxxxx@xxxx.com"
mRecip.Name = "xxxxxxx@xxxx.com"
mRet = mSes.mailResolveRecipient(mRecip)
if mRet <> mailReturnSuccess! then
messagebox("Dispatch e-Mail Error", "Failed to resolve recipient")
Return
end if

mMsg.NoteText = "This is a test of PowerBuilders mail capabilities."
mMsg.Subject = "PowerBuilder mail message"
mMsg.Recipient[1] = mRecip

"jking" <kingjd@phdnswc.navy.mil> wrote in message
news:ZTasUtcgCHA.296@forums.sybase.com...
> I get a mailReturnFailure! when executing the code below. I am running
> PB8.01 Build 9056 my Mail client is MSOutLook 2000 (9.0.0.2711)
[Microsoft
> Exchange Server]. What am I doing wrong?
>
> Thanks,
> Jking
>
>
> //
> mailsession lms_MAPISession
> mailmessage lmm_Message
>
> lms_MAPISession = CREATE mailsession
> IF lms_MAPISession.MailLogon() = MailReturnSuccess! THEN
> // Mail Sesion is ok so Populate the Message
> lmm_Message.Subject = 'Email Test' //sle_subject.text
> lmm_Message.NoteText = 'Another fine day in paradise.' //
mle_body.text
> lmm_Message.Recipient[ 1 ].Name = 'kingjd@phdnswc.navy.mil'
> //sle_to.text
> lmm_Message.Recipient[ 2 ].Name = 'speedbump92@yahoo.com' //
sle_cc.text
>
> choose case lms_MAPISession.MailSend( lmm_Message )
> case MailReturnSuccess!
> Messagebox( 'Mail', 'Message was sent.' )
> case mailReturnFailure!
> Messagebox( 'Mail', 'mailReturnFailure' )
> // <snipped >
> case else
> Messagebox( 'Mail', 'Other return code' )
> end choose
>
> lms_MAPISession.MailLogoff()
> END IF
>
> DESTROY lms_MAPISession
>
>
>


jking Posted on 2002-11-05 20:47:14.0Z
Newsgroups: sybase.public.powerbuilder.objects
Reply-To: "jking" <kingjd@phdnswc.navy.mil>
From: "jking" <kingjd@phdnswc.navy.mil>
Subject: Re: MAPI (mailReturnFailure!)
Date: Tue, 5 Nov 2002 12:47:14 -0800
Lines: 76
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 5.50.4807.1700
X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4807.1700
NNTP-Posting-Host: TITAN.PHDNSWC.NAVY.MIL 137.24.128.98
Message-ID: <364_uuzR46QhCHA.249@forums.sybase.com>
References: <364_ZTasUtcgCHA.296@forums.sybase.com> <364_COvKlK1gCHA.196@forums.sybase.com>
Path: forums-1-dub!forums-1-dub!forums-master.sybase.com!forums.sybase.com
Xref: forums-1-dub sybase.public.powerbuilder.objects:796
Article PK: 713364

I did what you suggested, but it fails when trying to resolve the recipient
name. I also tried "SMTP:xxxx@xxxxx.com" but still fails. I'm able to get
it working with same code from home, only difference is I'm not using MS
Exchange Server at home. I am at a loss. Is there something in Exchange
thats causing this problem, any known bug about this?

JKing

"Andy Turiansky [TeamSybase]" <aturiansky@comcast.net> wrote in message
news:COvKlK1gCHA.196@forums.sybase.com...
> It looks like you are missing the setting of the address to send to. You
> are only setting the display name. See the following snippet:
>
>
> mMsg.Recipient[1].Address = "xxxxxx@xxxx.com"
> mRecip.Name = "xxxxxxx@xxxx.com"
> mRet = mSes.mailResolveRecipient(mRecip)
> if mRet <> mailReturnSuccess! then
> messagebox("Dispatch e-Mail Error", "Failed to resolve recipient")
> Return
> end if
>
> mMsg.NoteText = "This is a test of PowerBuilders mail capabilities."
> mMsg.Subject = "PowerBuilder mail message"
> mMsg.Recipient[1] = mRecip
>
>
>
>
> "jking" <kingjd@phdnswc.navy.mil> wrote in message
> news:ZTasUtcgCHA.296@forums.sybase.com...
> > I get a mailReturnFailure! when executing the code below. I am running
> > PB8.01 Build 9056 my Mail client is MSOutLook 2000 (9.0.0.2711)
> [Microsoft
> > Exchange Server]. What am I doing wrong?
> >
> > Thanks,
> > Jking
> >
> >
> > //
> > mailsession lms_MAPISession
> > mailmessage lmm_Message
> >
> > lms_MAPISession = CREATE mailsession
> > IF lms_MAPISession.MailLogon() = MailReturnSuccess! THEN
> > // Mail Sesion is ok so Populate the Message
> > lmm_Message.Subject = 'Email Test' //sle_subject.text
> > lmm_Message.NoteText = 'Another fine day in paradise.' //
> mle_body.text
> > lmm_Message.Recipient[ 1 ].Name = 'kingjd@phdnswc.navy.mil'
> > //sle_to.text
> > lmm_Message.Recipient[ 2 ].Name = 'speedbump92@yahoo.com' //
> sle_cc.text
> >
> > choose case lms_MAPISession.MailSend( lmm_Message )
> > case MailReturnSuccess!
> > Messagebox( 'Mail', 'Message was sent.' )
> > case mailReturnFailure!
> > Messagebox( 'Mail', 'mailReturnFailure' )
> > // <snipped >
> > case else
> > Messagebox( 'Mail', 'Other return code' )
> > end choose
> >
> > lms_MAPISession.MailLogoff()
> > END IF
> >
> > DESTROY lms_MAPISession
> >
> >
> >
>
>