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.

MailSend Issue

2 posts in Objects Last posting was on 2009-06-12 18:38:13.0Z
tericc Posted on 2009-06-12 18:36:07.0Z
Sender: 1957.4a329b38.1804289383@sybase.com
From: tericc
Newsgroups: sybase.public.powerbuilder.objects
Subject: MailSend Issue
X-Mailer: WebNews to Mail Gateway v1.1t
Message-ID: <4a32a017.19eb.1681692777@sybase.com>
NNTP-Posting-Host: 10.22.241.41
X-Original-NNTP-Posting-Host: 10.22.241.41
Date: 12 Jun 2009 11:36:07 -0700
X-Trace: forums-1-dub 1244831767 10.22.241.41 (12 Jun 2009 11:36:07 -0700)
X-Original-Trace: 12 Jun 2009 11:36:07 -0700, 10.22.241.41
Lines: 96
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.powerbuilder.objects:9853
Article PK: 736989

I need help on a mail interface that I am trying to include
to my PB 11.5.1 App. I am using Lotus Notes version 7.0.2
as my local mail client. I've tried following the MAPI
example of PB 8 and it works well until i got to the part
that I am using

mSes.mailsend ( mMsg )

partial code goes like

mSes = create mailSession

mRet = mSes.mailLogon ( mailNewSession! )
ls_ret = f_mail_error_to_string ( mRet, 'Logon:', FALSE )

If mRet <> mailReturnSuccess! Then
MessageBox ("Mail Logon", 'Return Code <>
mailReturnSuccess!' )
wf_logoff_mail(mSes, ls_path)
return
End If

SetPointer(HourGlass!)

mMsg.Subject = "Teric's Test"

mMsg.notetext = 'Attachement Testing'

mAttach.FileType = mailAttach!
mAttach.PathName = ls_path
mAttach.FileName = ls_filename

mAttach.Position = len(mMsg.notetext) - 1
mMsg.AttachmentFile[1] = mAttach


mRet = mSes.mailAddress ( mMsg )
If mRet = mailReturnUserAbort! Then
wf_logoff_mail(mSes, ls_filename)
Return
End If
ls_ret = f_mail_error_to_string ( mRet, 'Address Mail:',
FALSE )

SetPointer(HourGlass!)

Do
lb_noerrors = True
li_nrecipients = UpperBound( mMsg.Recipient )
mMsg.Recipient[1].name = 'etraya@seastarline.com'
For li_index = 1 To li_nrecipients
mRet =
mSes.mailResolveRecipient(mMsg.Recipient[li_index].Name)
If mRet <> mailReturnSuccess! Then lb_noerrors = False
ls_ret = f_mail_error_to_string ( mRet, 'Resolve
Recipient:', FALSE )
MessageBox('', ' Resolve Recipient (' +
mMsg.Recipient[li_index].Name + '): ' + ls_ret)
Next
If Not lb_noerrors Then
Messagebox("Microsoft Mail","Error Resolving
Name(s)~n~r"+&
"The name(s) not underlined are unresolvable.~n~n~rPlease
Correct or Cancel"&
,Exclamation!)
mRet = mSes.mailAddress(mMsg)
If mRet = mailReturnUserAbort! Then
wf_logoff_mail(mSes, ls_filename)
Return
End If
End If
Loop Until lb_noerrors

/*****************************************************************
Now, send the mail message, including the attachment

*****************************************************************/
If UpperBound ( mMsg.Recipient ) < 1 Then
messagebox ("Powerbuilder send","Mail must included at
least 1 recipient",Exclamation!)
wf_logoff_mail(mSes, ls_filename)
return
End If
mRet = mSes.mailsend ( mMsg )
ls_ret = f_mail_error_to_string ( mRet, 'send Mail:', FALSE
)
MessageBox('', ' send Mail: ' + ls_ret)

wf_logoff_mail(mSes, ls_filename)


the issue is when I get to the mRet = mSes.mailsend ( mMsg
)part, notes is not really sending it until the user press
the SEND button.

Any thoughts?


tericc Posted on 2009-06-12 18:38:13.0Z
Sender: 1957.4a329b38.1804289383@sybase.com
From: tericc
Newsgroups: sybase.public.powerbuilder.objects
Subject: Re: MailSend Issue
X-Mailer: WebNews to Mail Gateway v1.1t
Message-ID: <4a32a095.1a08.1681692777@sybase.com>
References: <4a32a017.19eb.1681692777@sybase.com>
NNTP-Posting-Host: 10.22.241.41
X-Original-NNTP-Posting-Host: 10.22.241.41
Date: 12 Jun 2009 11:38:13 -0700
X-Trace: forums-1-dub 1244831893 10.22.241.41 (12 Jun 2009 11:38:13 -0700)
X-Original-Trace: 12 Jun 2009 11:38:13 -0700, 10.22.241.41
Lines: 100
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.powerbuilder.objects:9854
Article PK: 736987

BTW, I am using Windows XP SP 3 and Oracle DB.

> I need help on a mail interface that I am trying to
> include to my PB 11.5.1 App. I am using Lotus Notes
> version 7.0.2 as my local mail client. I've tried
> following the MAPI example of PB 8 and it works well until
> i got to the part that I am using
>
> mSes.mailsend ( mMsg )
>
> partial code goes like
>
> mSes = create mailSession
>
> mRet = mSes.mailLogon ( mailNewSession! )
> ls_ret = f_mail_error_to_string ( mRet, 'Logon:', FALSE )
>
> If mRet <> mailReturnSuccess! Then
> MessageBox ("Mail Logon", 'Return Code <>
> mailReturnSuccess!' )
> wf_logoff_mail(mSes, ls_path)
> return
> End If
>
> SetPointer(HourGlass!)
>
> mMsg.Subject = "Teric's Test"
>
> mMsg.notetext = 'Attachement Testing'
>
> mAttach.FileType = mailAttach!
> mAttach.PathName = ls_path
> mAttach.FileName = ls_filename
>
> mAttach.Position = len(mMsg.notetext) - 1
> mMsg.AttachmentFile[1] = mAttach
>
>
> mRet = mSes.mailAddress ( mMsg )
> If mRet = mailReturnUserAbort! Then
> wf_logoff_mail(mSes, ls_filename)
> Return
> End If
> ls_ret = f_mail_error_to_string ( mRet, 'Address
> Mail:', FALSE )
>
> SetPointer(HourGlass!)
>
> Do
> lb_noerrors = True
> li_nrecipients = UpperBound( mMsg.Recipient )
> mMsg.Recipient[1].name = 'etraya@seastarline.com'
> For li_index = 1 To li_nrecipients
> mRet =
> mSes.mailResolveRecipient(mMsg.Recipient[li_index].Name)
> If mRet <> mailReturnSuccess! Then lb_noerrors =
> False
> ls_ret = f_mail_error_to_string ( mRet, 'Resolve
> Recipient:', FALSE )
> MessageBox('', ' Resolve Recipient (' +
> mMsg.Recipient[li_index].Name + '): ' + ls_ret)
> Next
> If Not lb_noerrors Then
> Messagebox("Microsoft Mail","Error Resolving
> Name(s)~n~r"+&
> "The name(s) not underlined are
> unresolvable.~n~n~rPlease Correct or Cancel"&
> ,Exclamation!)
> mRet = mSes.mailAddress(mMsg)
> If mRet = mailReturnUserAbort! Then
> wf_logoff_mail(mSes, ls_filename)
> Return
> End If
> End If
> Loop Until lb_noerrors
>
> /*********************************************************
> ********
> Now, send the mail message, including the attachment
>
> **********************************************************
> *******/ If UpperBound ( mMsg.Recipient ) < 1 Then
> messagebox ("Powerbuilder send","Mail must included at
> least 1 recipient",Exclamation!)
> wf_logoff_mail(mSes, ls_filename)
> return
> End If
> mRet = mSes.mailsend ( mMsg )
> ls_ret = f_mail_error_to_string ( mRet, 'send Mail:',
> FALSE )
> MessageBox('', ' send Mail: ' + ls_ret)
>
> wf_logoff_mail(mSes, ls_filename)
>
>
> the issue is when I get to the mRet = mSes.mailsend ( mMsg
> )part, notes is not really sending it until the user press
> the SEND button.
>
> Any thoughts?