Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

PB 6.5 and sending e-mail

Status
Not open for further replies.

B2BGURU

IS-IT--Management
May 16, 2002
17
US
I have a PB 6.5 Order Entry system and would like to modify it to send e-Mail confirmations and shipping notifications to my customers. Could someone please point me in the right direction on how to accomplish this in the most efficient way. If this sounds elementary - it may well be, I have not touched PB in over 2 years. Do I have to upgrade my PB Version ???
Any help would be greatly appreciated -
 
Hi there,
Check the MAPI commands in pb. available in the help file.

EX:
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(&quot;Mail&quot;, 'Logon failed.')
RETURN

END IF

// Populate the mailMessage structure

mMsg.Subject = mle_subject.Text

mMsg.NoteText = 'Luncheon at 12:15'

mMsg.Recipient[1].name = 'Smith, John'

mMsg.Recipient[2].name = 'Shaw, Sue'

// Send the mail

mRet = mSes.mailSend(mMsg)

IF mRet <> mailReturnSuccess! THEN
MessageBox(&quot;Mail Send&quot;, 'Mail not sent')
RETURN

END IF

mSes.mailLogoff()

DESTROY mSes
 
Thanks sajuks,
How does PB know it's connecting to an address on the internet (i.e. testname@yahoo.com) ? does that go into the recipient field? Do I have to configure PB to the mail server or does it do it on the fly thru the OS. Also can I BCC someone as well? Do I have to worry about how I format the body of the message?
So many questions?
Thanks for the quick response
 
You can use,
mMsg.Recipient[1].name = &quot;testname@yahoo.com&quot;.

No need to configure Pb.

 
For BCC
----------
The RecipientType attribute is of the mailRecipientType enumerated type. The values for this enumerated type are mailTo!, mailCC!, mailOriginator!, and mailBCC!. The suffixes stand for the following:

To--The recipient of the message

CC--The addressees receive carbon copies of the message

Originator--The message sender (used only with received messages)

BCC (blind carbon copy)--These recipients are not shown to CC and To recipients


Formatting is upto you to decide.
you can save as an attachment or as a psr the notification and send it using the mail functions.
 
Hi,

I already have my MS Outlook open, when i run my application, when reach create mailsession, it still prompt me to configure the internet mail information.

After i fill up all the information, and successfully maillogon with MailNewSession!, but why does it not open a new compose in my Outlook?

I am not familiar with email features, what u want is when i create a new mail, it will auto open a new compose from MS Outlook or Outlook express. So that user can add any description to the subject or text.

Thanks a lot
 
Hi,

I finally have it open in a new mail in Outlook Express by using MailMessage with the mailSend command (funny things witout mailSend command, it will not open the new mail format), but the thing is i want to it to work with MS Outlook instead of Outlook Express.... How could i do it.

Thanks in advance.
 
I Setup the Mail Message object with Outlook express as the default e-mail pgm (following your recommendation and post - Thanks for that). It Works like a charm but for 1 thing. It still challenges me for my permission to send. I need this to be seamless so the PB Program can send an email confirmation everytime the program creates a shipping document. I can't have the user say yes to 300 emails a day. Any ideas how to eliminate the challenge???
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top