dantheinfoman
Programmer
Hi All,
I tried to be as expressive in the title as can be, but essentially, I'm trying to send emails with MAPI session using Thunderbird. Some considerations:
1. Thunderbird IS default mail application.
2. This procedure works when I'm debugging the code, just not when I compile the EXE and do the procedure, UNLESS Thunderbird is closed, then it will open Thunderbird and send the email. ..
3. When debugging, I notice the loMail.OleMSess.SessionID is incrementing by one, first it's 1, then 2, etc.
Why is it the compiled version can't latch onto the current session and says that Thunderbird is busy?
Here's my code that works in debug (or if Thunderbird is first closed in compile mode):
I've had this problem in the past with Outlook 2013 and I had given up. It would ALWAYS say that Outlook is busy and to Retry or Wait for the program, then it'd error out. Foxypreviewer trying to send an Outlook email, for example, only works on my machine if Outlook is closed. Then Foxypreviewer opens Outlook and sends the email, otherwise it gives me that stupid 'This program is busy' message. Have never found help for these email issues despite searching the web and experimenting a lot.
Thanks for any help!
Dan
I tried to be as expressive in the title as can be, but essentially, I'm trying to send emails with MAPI session using Thunderbird. Some considerations:
1. Thunderbird IS default mail application.
2. This procedure works when I'm debugging the code, just not when I compile the EXE and do the procedure, UNLESS Thunderbird is closed, then it will open Thunderbird and send the email. ..
3. When debugging, I notice the loMail.OleMSess.SessionID is incrementing by one, first it's 1, then 2, etc.
Why is it the compiled version can't latch onto the current session and says that Thunderbird is busy?
Here's my code that works in debug (or if Thunderbird is first closed in compile mode):
Code:
SET CLASSLIB TO "..\classes\buttons.vcx" ADDITIVE
loMail = NEWOBJECT('mailbtn','..\classes\buttons.vcx')
***compiling the email body stuff here***
***********************************************************
* Start Email
***********************************************************
SET STEP ON
*!* IF !loMail.signon() && Use the custom method
*!* RETURN
*!* ENDIF
loMail.signon()
DOEVENTS &&added due to [URL unfurl="true"]http://www.tek-tips.com/viewthread.cfm?qid=429405[/URL]
IF loMail.LogSession && Check if the user was able to login
loMail.OleMMess.sessionid=loMail.OleMSess.sessionid
**loMail.OleMSess.sessionid =1
WAIT WINDOW loMail.OleMSess.newsession
m.subject = 'DAILY PROSPECT ALERTS'
m.address = C_EMADDS.e_mail
WITH loMail
.olemmess.compose &&msgindex=-1
.OleMMess.msgnotetext=IIF(EMPTY(m.lcMailBody),'No New Communications Available',m.lcMailBody)
*!* this.parent.OleMMess.msgsubject=this.parent.strippath(alltrim(dbf()))+": "+RECORDNUM_LOC+alltrim(str(recno()))
.OleMMess.msgsubject=m.subject
.OleMMess.recipaddress=m.address
*.OleMMess.resolveall &&?? ds
.OleMMess.send
***IF .logsession
*** .OleMSess.signoff && This part gets really mad and errors out, commented out. Probably why SessionID increments by one. . .
***ENDIF && Session Handle test
ENDWITH
ENDIF
***********************************************************
* End Email
***********************************************************
I've had this problem in the past with Outlook 2013 and I had given up. It would ALWAYS say that Outlook is busy and to Retry or Wait for the program, then it'd error out. Foxypreviewer trying to send an Outlook email, for example, only works on my machine if Outlook is closed. Then Foxypreviewer opens Outlook and sends the email, otherwise it gives me that stupid 'This program is busy' message. Have never found help for these email issues despite searching the web and experimenting a lot.
Thanks for any help!
Dan