A bit about my environment... My mail server is on the same LAN as my routine below which is running from my laptop.
Here is my code (excluding SMTP setup):
DO wwSmtp
LOCAL loSmtp as wwSmtp*** setup smtp properties goes here along with opening table ***
SELECT('myList')
loSmtp.Connect()
SCAN* prevent from sending twice
IF NOT EMPTY(result)
LOOP
ENDIFloSmtp.cRecipient = ["] +ALLTRIM(STRTRAN(sender,',',' ')) + '" <' + ALLTRIM(email) +'>'
*loSmtp.cReplyTo = ALLTRIM(AcntName)
*** Now Sending ***
llResult = loSmtp.SendMessage()
* WAIT TIMEOUT .25
IF llResult
REPLACE Result WITH TRANSFORM(DATETIME())
ELSE
REPLACE Result WITH LEFT( loSmtp.cErrorMsg, 100)
ENDIFENDSCAN
loSmtp.Close()
I've left out all of the setup code for SMPT but basically copied and pasted in the sample code from the SendMessage documentation. And since the first message gets delivered correctly the problem is not in the configuration of SMTP.
Any help would be most welcome...
--hm--
--hm
OK, the my error still seems to exist when trying to send using the following code. The first address from my mailing list table goes without any problems be 2-n all show Incomplete-Session in the server logs.
A bit about my environment... My mail server is on the same LAN as my routine below which is running from my laptop.
Here is my code (excluding SMTP setup):
DO wwSmtp
LOCAL loSmtp as wwSmtp*** setup smtp properties goes here along with opening table ***
SELECT('myList')
loSmtp.Connect()
SCAN* prevent from sending twice
IF NOT EMPTY(result)
LOOP
ENDIFloSmtp.cRecipient = ["] +ALLTRIM(STRTRAN(sender,',',' ')) + '" <' + ALLTRIM(email) +'>'
*loSmtp.cReplyTo = ALLTRIM(AcntName)
*** Now Sending ***
llResult = loSmtp.SendMessage()
* WAIT TIMEOUT .25
IF llResult
REPLACE Result WITH TRANSFORM(DATETIME())
ELSE
REPLACE Result WITH LEFT( loSmtp.cErrorMsg, 100)
ENDIFENDSCAN
loSmtp.Close()
I've left out all of the setup code for SMPT but basically copied and pasted in the sample code from the SendMessage documentation. And since the first message gets delivered correctly the problem is not in the configuration of SMTP.
Any help would be most welcome...
--hm--
Is this by design or could it be related to the cause of the problem...?
--hm
FYI - in testing if I move the loSmtp.Connect and loSmtp.Dispose into the SCAN loop (with connect at the top and dispose at the end), the server accepts and sends all of the messages without error.
--hm
OK, the my error still seems to exist when trying to send using the following code. The first address from my mailing list table goes without any problems be 2-n all show Incomplete-Session in the server logs.
A bit about my environment... My mail server is on the same LAN as my routine below which is running from my laptop.
Here is my code (excluding SMTP setup):
DO wwSmtp
LOCAL loSmtp as wwSmtp*** setup smtp properties goes here along with opening table ***
SELECT('myList')
loSmtp.Connect()
SCAN* prevent from sending twice
IF NOT EMPTY(result)
LOOP
ENDIFloSmtp.cRecipient = ["] +ALLTRIM(STRTRAN(sender,',',' ')) + '" <' + ALLTRIM(email) +'>'
*loSmtp.cReplyTo = ALLTRIM(AcntName)
*** Now Sending ***
llResult = loSmtp.SendMessage()
* WAIT TIMEOUT .25
IF llResult
REPLACE Result WITH TRANSFORM(DATETIME())
ELSE
REPLACE Result WITH LEFT( loSmtp.cErrorMsg, 100)
ENDIFENDSCAN
loSmtp.Close()
I've left out all of the setup code for SMPT but basically copied and pasted in the sample code from the SendMessage documentation. And since the first message gets delivered correctly the problem is not in the configuration of SMTP.
Any help would be most welcome...
--hm--
I just double checked this on my machine.
Can you setup the wwSmtp_sample.prg in the wwIpstuff_samples folder by just modifying for your mail server setup? One of the options in that file (commented out by default) is to make two SendMessage calls in a row. I ran that code and I got two email messages. Please check with that code... I used GMail for testing as well as my ISP here in Hood River and it worked with both. Maybe if it doesn't work try using a GMail or other public account to see if that gives different results.
If that doesn't work I'm not sure. It could be some mail server compatibility issue...
+++ Rick ---
OK, the my error still seems to exist when trying to send using the following code. The first address from my mailing list table goes without any problems be 2-n all show Incomplete-Session in the server logs.
A bit about my environment... My mail server is on the same LAN as my routine below which is running from my laptop.
Here is my code (excluding SMTP setup):
DO wwSmtp
LOCAL loSmtp as wwSmtp*** setup smtp properties goes here along with opening table ***
SELECT('myList')
loSmtp.Connect()
SCAN* prevent from sending twice
IF NOT EMPTY(result)
LOOP
ENDIFloSmtp.cRecipient = ["] +ALLTRIM(STRTRAN(sender,',',' ')) + '" <' + ALLTRIM(email) +'>'
*loSmtp.cReplyTo = ALLTRIM(AcntName)
*** Now Sending ***
llResult = loSmtp.SendMessage()
* WAIT TIMEOUT .25
IF llResult
REPLACE Result WITH TRANSFORM(DATETIME())
ELSE
REPLACE Result WITH LEFT( loSmtp.cErrorMsg, 100)
ENDIFENDSCAN
loSmtp.Close()
I've left out all of the setup code for SMPT but basically copied and pasted in the sample code from the SendMessage documentation. And since the first message gets delivered correctly the problem is not in the configuration of SMTP.
Any help would be most welcome...
West Wind Technologies
Making waves on the Web
from Maui
+++ Rick ---
FYI - in testing if I move the loSmtp.Connect and loSmtp.Dispose into the SCAN loop (with connect at the top and dispose at the end), the server accepts and sends all of the messages without error.
--hm
OK, the my error still seems to exist when trying to send using the following code. The first address from my mailing list table goes without any problems be 2-n all show Incomplete-Session in the server logs.
A bit about my environment... My mail server is on the same LAN as my routine below which is running from my laptop.
Here is my code (excluding SMTP setup):
DO wwSmtp
LOCAL loSmtp as wwSmtp*** setup smtp properties goes here along with opening table ***
SELECT('myList')
loSmtp.Connect()
SCAN* prevent from sending twice
IF NOT EMPTY(result)
LOOP
ENDIFloSmtp.cRecipient = ["] +ALLTRIM(STRTRAN(sender,',',' ')) + '" <' + ALLTRIM(email) +'>'
*loSmtp.cReplyTo = ALLTRIM(AcntName)
*** Now Sending ***
llResult = loSmtp.SendMessage()
* WAIT TIMEOUT .25
IF llResult
REPLACE Result WITH TRANSFORM(DATETIME())
ELSE
REPLACE Result WITH LEFT( loSmtp.cErrorMsg, 100)
ENDIFENDSCAN
loSmtp.Close()
I've left out all of the setup code for SMPT but basically copied and pasted in the sample code from the SendMessage documentation. And since the first message gets delivered correctly the problem is not in the configuration of SMTP.
Any help would be most welcome...
West Wind Technologies
Making waves on the Web
from Maui
--hm
Well, then just use SendMail() which is easier. SendMessage() is meant to send multiple messages from a single connection which is faster... if speed isn't important using SendMail() is fine... since apparently there's some sort of conflict between client and server for multiple sends on the same connection.
+++ Rick ---
FYI - in testing if I move the loSmtp.Connect and loSmtp.Dispose into the SCAN loop (with connect at the top and dispose at the end), the server accepts and sends all of the messages without error.
--hm
OK, the my error still seems to exist when trying to send using the following code. The first address from my mailing list table goes without any problems be 2-n all show Incomplete-Session in the server logs.
A bit about my environment... My mail server is on the same LAN as my routine below which is running from my laptop.
Here is my code (excluding SMTP setup):
DO wwSmtp
LOCAL loSmtp as wwSmtp*** setup smtp properties goes here along with opening table ***
SELECT('myList')
loSmtp.Connect()
SCAN* prevent from sending twice
IF NOT EMPTY(result)
LOOP
ENDIFloSmtp.cRecipient = ["] +ALLTRIM(STRTRAN(sender,',',' ')) + '" <' + ALLTRIM(email) +'>'
*loSmtp.cReplyTo = ALLTRIM(AcntName)
*** Now Sending ***
llResult = loSmtp.SendMessage()
* WAIT TIMEOUT .25
IF llResult
REPLACE Result WITH TRANSFORM(DATETIME())
ELSE
REPLACE Result WITH LEFT( loSmtp.cErrorMsg, 100)
ENDIFENDSCAN
loSmtp.Close()
I've left out all of the setup code for SMPT but basically copied and pasted in the sample code from the SendMessage documentation. And since the first message gets delivered correctly the problem is not in the configuration of SMTP.
Any help would be most welcome...
--hm--
My setup code was the issue...
DO wwSmtp
LOCAL loSmtp as wwSmtp
loSmtp = CREATEOBJECT("wwSmtp")* loSmtp.nMailMode = 0 && .NET 2 - classic (default)
By commenting out the nMailMode = 0 which I understood used the .NET version of WC, o.SendMessage looping inside the o.Connect to o.Close now works fine.
Who knew... :-)
--hm
Jim,
I just double checked this on my machine.
Can you setup the wwSmtp_sample.prg in the wwIpstuff_samples folder by just modifying for your mail server setup? One of the options in that file (commented out by default) is to make two SendMessage calls in a row. I ran that code and I got two email messages. Please check with that code... I used GMail for testing as well as my ISP here in Hood River and it worked with both. Maybe if it doesn't work try using a GMail or other public account to see if that gives different results.
If that doesn't work I'm not sure. It could be some mail server compatibility issue...
+++ Rick ---
OK, the my error still seems to exist when trying to send using the following code. The first address from my mailing list table goes without any problems be 2-n all show Incomplete-Session in the server logs.
A bit about my environment... My mail server is on the same LAN as my routine below which is running from my laptop.
Here is my code (excluding SMTP setup):
DO wwSmtp
LOCAL loSmtp as wwSmtp*** setup smtp properties goes here along with opening table ***
SELECT('myList')
loSmtp.Connect()
SCAN* prevent from sending twice
IF NOT EMPTY(result)
LOOP
ENDIFloSmtp.cRecipient = ["] +ALLTRIM(STRTRAN(sender,',',' ')) + '" <' + ALLTRIM(email) +'>'
*loSmtp.cReplyTo = ALLTRIM(AcntName)
*** Now Sending ***
llResult = loSmtp.SendMessage()
* WAIT TIMEOUT .25
IF llResult
REPLACE Result WITH TRANSFORM(DATETIME())
ELSE
REPLACE Result WITH LEFT( loSmtp.cErrorMsg, 100)
ENDIFENDSCAN
loSmtp.Close()
I've left out all of the setup code for SMPT but basically copied and pasted in the sample code from the SendMessage documentation. And since the first message gets delivered correctly the problem is not in the configuration of SMTP.
Any help would be most welcome...
--hm--
The default mode doesn't use .NET so you're going through a completely different pipeline to send emails.
If the .NET code doesn't work check for errors. Most likely you don't have .NET installed on your server.
+++ Rick ---
Discovered what was causing my problem although not sure why it does not work?
My setup code was the issue...
DO wwSmtp
LOCAL loSmtp as wwSmtp
loSmtp = CREATEOBJECT("wwSmtp")* loSmtp.nMailMode = 0 && .NET 2 - classic (default)
By commenting out the nMailMode = 0 which I understood used the .NET version of WC, o.SendMessage looping inside the o.Connect to o.Close now works fine.
Who knew... :-)
--hm
Jim,
I just double checked this on my machine.
Can you setup the wwSmtp_sample.prg in the wwIpstuff_samples folder by just modifying for your mail server setup? One of the options in that file (commented out by default) is to make two SendMessage calls in a row. I ran that code and I got two email messages. Please check with that code... I used GMail for testing as well as my ISP here in Hood River and it worked with both. Maybe if it doesn't work try using a GMail or other public account to see if that gives different results.
If that doesn't work I'm not sure. It could be some mail server compatibility issue...
+++ Rick ---
OK, the my error still seems to exist when trying to send using the following code. The first address from my mailing list table goes without any problems be 2-n all show Incomplete-Session in the server logs.
A bit about my environment... My mail server is on the same LAN as my routine below which is running from my laptop.
Here is my code (excluding SMTP setup):
DO wwSmtp
LOCAL loSmtp as wwSmtp*** setup smtp properties goes here along with opening table ***
SELECT('myList')
loSmtp.Connect()
SCAN* prevent from sending twice
IF NOT EMPTY(result)
LOOP
ENDIFloSmtp.cRecipient = ["] +ALLTRIM(STRTRAN(sender,',',' ')) + '" <' + ALLTRIM(email) +'>'
*loSmtp.cReplyTo = ALLTRIM(AcntName)
*** Now Sending ***
llResult = loSmtp.SendMessage()
* WAIT TIMEOUT .25
IF llResult
REPLACE Result WITH TRANSFORM(DATETIME())
ELSE
REPLACE Result WITH LEFT( loSmtp.cErrorMsg, 100)
ENDIFENDSCAN
loSmtp.Close()
I've left out all of the setup code for SMPT but basically copied and pasted in the sample code from the SendMessage documentation. And since the first message gets delivered correctly the problem is not in the configuration of SMTP.
Any help would be most welcome...
West Wind Technologies
Making waves on the Web
from Maui
Because your reply threw me a curve with the word "server" having dot net, I also looked at the system which the mail server sits on. Mind you this machine is strictly used for mail which is not Exchange so the need for dot NET has never come up before. It is running version 1.1 which I assume was installed at the time the machine was configured.
--hm
The default mode doesn't use .NET so you're going through a completely different pipeline to send emails.
If the .NET code doesn't work check for errors. Most likely you don't have .NET installed on your server.
+++ Rick ---
Discovered what was causing my problem although not sure why it does not work?
My setup code was the issue...
DO wwSmtp
LOCAL loSmtp as wwSmtp
loSmtp = CREATEOBJECT("wwSmtp")* loSmtp.nMailMode = 0 && .NET 2 - classic (default)
By commenting out the nMailMode = 0 which I understood used the .NET version of WC, o.SendMessage looping inside the o.Connect to o.Close now works fine.
Who knew... :-)
--hm
Jim,
I just double checked this on my machine.
Can you setup the wwSmtp_sample.prg in the wwIpstuff_samples folder by just modifying for your mail server setup? One of the options in that file (commented out by default) is to make two SendMessage calls in a row. I ran that code and I got two email messages. Please check with that code... I used GMail for testing as well as my ISP here in Hood River and it worked with both. Maybe if it doesn't work try using a GMail or other public account to see if that gives different results.
If that doesn't work I'm not sure. It could be some mail server compatibility issue...
+++ Rick ---
OK, the my error still seems to exist when trying to send using the following code. The first address from my mailing list table goes without any problems be 2-n all show Incomplete-Session in the server logs.
A bit about my environment... My mail server is on the same LAN as my routine below which is running from my laptop.
Here is my code (excluding SMTP setup):
DO wwSmtp
LOCAL loSmtp as wwSmtp*** setup smtp properties goes here along with opening table ***
SELECT('myList')
loSmtp.Connect()
SCAN* prevent from sending twice
IF NOT EMPTY(result)
LOOP
ENDIFloSmtp.cRecipient = ["] +ALLTRIM(STRTRAN(sender,',',' ')) + '" <' + ALLTRIM(email) +'>'
*loSmtp.cReplyTo = ALLTRIM(AcntName)
*** Now Sending ***
llResult = loSmtp.SendMessage()
* WAIT TIMEOUT .25
IF llResult
REPLACE Result WITH TRANSFORM(DATETIME())
ELSE
REPLACE Result WITH LEFT( loSmtp.cErrorMsg, 100)
ENDIFENDSCAN
loSmtp.Close()
I've left out all of the setup code for SMPT but basically copied and pasted in the sample code from the SendMessage documentation. And since the first message gets delivered correctly the problem is not in the configuration of SMTP.
Any help would be most welcome...
--hm--
You only need .NET from wherever you are sending the email not on the server - I just assumed you were doing this on your server FoxPro application.
+++ Rick ---
I'm running the VFP routing on my laptop. I would think all the code is executing on it and the only server in this case would be my mail server. In this case my version of Dot NET is 4.5. I will send you a screen shot offline.
Because your reply threw me a curve with the word "server" having dot net, I also looked at the system which the mail server sits on. Mind you this machine is strictly used for mail which is not Exchange so the need for dot NET has never come up before. It is running version 1.1 which I assume was installed at the time the machine was configured.
--hm
The default mode doesn't use .NET so you're going through a completely different pipeline to send emails.
If the .NET code doesn't work check for errors. Most likely you don't have .NET installed on your server.
+++ Rick ---
Discovered what was causing my problem although not sure why it does not work?
My setup code was the issue...
DO wwSmtp
LOCAL loSmtp as wwSmtp
loSmtp = CREATEOBJECT("wwSmtp")* loSmtp.nMailMode = 0 && .NET 2 - classic (default)
By commenting out the nMailMode = 0 which I understood used the .NET version of WC, o.SendMessage looping inside the o.Connect to o.Close now works fine.
Who knew... :-)
--hm
Jim,
I just double checked this on my machine.
Can you setup the wwSmtp_sample.prg in the wwIpstuff_samples folder by just modifying for your mail server setup? One of the options in that file (commented out by default) is to make two SendMessage calls in a row. I ran that code and I got two email messages. Please check with that code... I used GMail for testing as well as my ISP here in Hood River and it worked with both. Maybe if it doesn't work try using a GMail or other public account to see if that gives different results.
If that doesn't work I'm not sure. It could be some mail server compatibility issue...
+++ Rick ---
OK, the my error still seems to exist when trying to send using the following code. The first address from my mailing list table goes without any problems be 2-n all show Incomplete-Session in the server logs.
A bit about my environment... My mail server is on the same LAN as my routine below which is running from my laptop.
Here is my code (excluding SMTP setup):
DO wwSmtp
LOCAL loSmtp as wwSmtp*** setup smtp properties goes here along with opening table ***
SELECT('myList')
loSmtp.Connect()
SCAN* prevent from sending twice
IF NOT EMPTY(result)
LOOP
ENDIFloSmtp.cRecipient = ["] +ALLTRIM(STRTRAN(sender,',',' ')) + '" <' + ALLTRIM(email) +'>'
*loSmtp.cReplyTo = ALLTRIM(AcntName)
*** Now Sending ***
llResult = loSmtp.SendMessage()
* WAIT TIMEOUT .25
IF llResult
REPLACE Result WITH TRANSFORM(DATETIME())
ELSE
REPLACE Result WITH LEFT( loSmtp.cErrorMsg, 100)
ENDIFENDSCAN
loSmtp.Close()
I've left out all of the setup code for SMPT but basically copied and pasted in the sample code from the SendMessage documentation. And since the first message gets delivered correctly the problem is not in the configuration of SMTP.
Any help would be most welcome...
West Wind Technologies
Making waves on the Web
from Maui
Reminder....
SendMessage() where the loSmtp.Connect() is before the SCAN loop of email addresses to send and where the loSmtp.Close() is after the ENDSCAN.
If I Connect() and Close() within the scan loop using the dotNET provider, then it works fine. But not as your documentation suggests where connection is held open for the duration of the loop.
This error is reproducible by copying your code from the online documentation and only changing this one parameter
loSmtp.nMailMode = 0
If you don't have this problem, I will be very surprised!
Thank you in advance for taking the time to look again.
--hm
You only need .NET from wherever you are sending the email not on the server - I just assumed you were doing this on your server FoxPro application.
+++ Rick ---
I'm running the VFP routing on my laptop. I would think all the code is executing on it and the only server in this case would be my mail server. In this case my version of Dot NET is 4.5. I will send you a screen shot offline.
Because your reply threw me a curve with the word "server" having dot net, I also looked at the system which the mail server sits on. Mind you this machine is strictly used for mail which is not Exchange so the need for dot NET has never come up before. It is running version 1.1 which I assume was installed at the time the machine was configured.
--hm
The default mode doesn't use .NET so you're going through a completely different pipeline to send emails.
If the .NET code doesn't work check for errors. Most likely you don't have .NET installed on your server.
+++ Rick ---
Discovered what was causing my problem although not sure why it does not work?
My setup code was the issue...
DO wwSmtp
LOCAL loSmtp as wwSmtp
loSmtp = CREATEOBJECT("wwSmtp")* loSmtp.nMailMode = 0 && .NET 2 - classic (default)
By commenting out the nMailMode = 0 which I understood used the .NET version of WC, o.SendMessage looping inside the o.Connect to o.Close now works fine.
Who knew... :-)
--hm
Jim,
I just double checked this on my machine.
Can you setup the wwSmtp_sample.prg in the wwIpstuff_samples folder by just modifying for your mail server setup? One of the options in that file (commented out by default) is to make two SendMessage calls in a row. I ran that code and I got two email messages. Please check with that code... I used GMail for testing as well as my ISP here in Hood River and it worked with both. Maybe if it doesn't work try using a GMail or other public account to see if that gives different results.
If that doesn't work I'm not sure. It could be some mail server compatibility issue...
+++ Rick ---
OK, the my error still seems to exist when trying to send using the following code. The first address from my mailing list table goes without any problems be 2-n all show Incomplete-Session in the server logs.
A bit about my environment... My mail server is on the same LAN as my routine below which is running from my laptop.
Here is my code (excluding SMTP setup):
DO wwSmtp
LOCAL loSmtp as wwSmtp*** setup smtp properties goes here along with opening table ***
SELECT('myList')
loSmtp.Connect()
SCAN* prevent from sending twice
IF NOT EMPTY(result)
LOOP
ENDIFloSmtp.cRecipient = ["] +ALLTRIM(STRTRAN(sender,',',' ')) + '" <' + ALLTRIM(email) +'>'
*loSmtp.cReplyTo = ALLTRIM(AcntName)
*** Now Sending ***
llResult = loSmtp.SendMessage()
* WAIT TIMEOUT .25
IF llResult
REPLACE Result WITH TRANSFORM(DATETIME())
ELSE
REPLACE Result WITH LEFT( loSmtp.cErrorMsg, 100)
ENDIFENDSCAN
loSmtp.Close()
I've left out all of the setup code for SMPT but basically copied and pasted in the sample code from the SendMessage documentation. And since the first message gets delivered correctly the problem is not in the configuration of SMTP.
Any help would be most welcome...
--hm--
I'm not sure what you're saying. in MailMode 0 you can just send messages and leave the connection open. That only works in .NET. The classic version will always open and close connections for everything.
+++ Rick ---
Then the error is real and you need to take another look!
Reminder....
SendMessage() where the loSmtp.Connect() is before the SCAN loop of email addresses to send and where the loSmtp.Close() is after the ENDSCAN.
If I Connect() and Close() within the scan loop using the dotNET provider, then it works fine. But not as your documentation suggests where connection is held open for the duration of the loop.
This error is reproducible by copying your code from the online documentation and only changing this one parameter
loSmtp.nMailMode = 0
If you don't have this problem, I will be very surprised!
Thank you in advance for taking the time to look again.
--hm
You only need .NET from wherever you are sending the email not on the server - I just assumed you were doing this on your server FoxPro application.
+++ Rick ---
I'm running the VFP routing on my laptop. I would think all the code is executing on it and the only server in this case would be my mail server. In this case my version of Dot NET is 4.5. I will send you a screen shot offline.
Because your reply threw me a curve with the word "server" having dot net, I also looked at the system which the mail server sits on. Mind you this machine is strictly used for mail which is not Exchange so the need for dot NET has never come up before. It is running version 1.1 which I assume was installed at the time the machine was configured.
--hm
The default mode doesn't use .NET so you're going through a completely different pipeline to send emails.
If the .NET code doesn't work check for errors. Most likely you don't have .NET installed on your server.
+++ Rick ---
Discovered what was causing my problem although not sure why it does not work?
My setup code was the issue...
DO wwSmtp
LOCAL loSmtp as wwSmtp
loSmtp = CREATEOBJECT("wwSmtp")* loSmtp.nMailMode = 0 && .NET 2 - classic (default)
By commenting out the nMailMode = 0 which I understood used the .NET version of WC, o.SendMessage looping inside the o.Connect to o.Close now works fine.
Who knew... :-)
--hm
Jim,
I just double checked this on my machine.
Can you setup the wwSmtp_sample.prg in the wwIpstuff_samples folder by just modifying for your mail server setup? One of the options in that file (commented out by default) is to make two SendMessage calls in a row. I ran that code and I got two email messages. Please check with that code... I used GMail for testing as well as my ISP here in Hood River and it worked with both. Maybe if it doesn't work try using a GMail or other public account to see if that gives different results.
If that doesn't work I'm not sure. It could be some mail server compatibility issue...
+++ Rick ---
OK, the my error still seems to exist when trying to send using the following code. The first address from my mailing list table goes without any problems be 2-n all show Incomplete-Session in the server logs.
A bit about my environment... My mail server is on the same LAN as my routine below which is running from my laptop.
Here is my code (excluding SMTP setup):
DO wwSmtp
LOCAL loSmtp as wwSmtp*** setup smtp properties goes here along with opening table ***
SELECT('myList')
loSmtp.Connect()
SCAN* prevent from sending twice
IF NOT EMPTY(result)
LOOP
ENDIFloSmtp.cRecipient = ["] +ALLTRIM(STRTRAN(sender,',',' ')) + '" <' + ALLTRIM(email) +'>'
*loSmtp.cReplyTo = ALLTRIM(AcntName)
*** Now Sending ***
llResult = loSmtp.SendMessage()
* WAIT TIMEOUT .25
IF llResult
REPLACE Result WITH TRANSFORM(DATETIME())
ELSE
REPLACE Result WITH LEFT( loSmtp.cErrorMsg, 100)
ENDIFENDSCAN
loSmtp.Close()
I've left out all of the setup code for SMPT but basically copied and pasted in the sample code from the SendMessage documentation. And since the first message gets delivered correctly the problem is not in the configuration of SMTP.
Any help would be most welcome...
West Wind Technologies
Making waves on the Web
from Maui
Hum... something stinks like rotten fish!! <frown>
Then after another hour plus of comparing my code to your sample, I discovered one slight difference.
loSmtp.AddAttachment("C:\myFolder\myAcrobatFile.pdf","pdf/application")VS.
loSmtp.cAttachment = "C:\myFolder\myAcrobatFile.pdf"
What I've discovered is cAttachment works in both classic nMailMode and in dot NET. On the other hand, AddAttachment only works on the first message inside the loop when dot NET nMailMode is selected.
Bug or Feature?
....James@Cranky.com! <g>
--hm
I'm not sure what you're saying. in MailMode 0 you can just send messages and leave the connection open. That only works in .NET. The classic version will always open and close connections for everything.
+++ Rick ---
Then the error is real and you need to take another look!
Reminder....
SendMessage() where the loSmtp.Connect() is before the SCAN loop of email addresses to send and where the loSmtp.Close() is after the ENDSCAN.
If I Connect() and Close() within the scan loop using the dotNET provider, then it works fine. But not as your documentation suggests where connection is held open for the duration of the loop.
This error is reproducible by copying your code from the online documentation and only changing this one parameter
loSmtp.nMailMode = 0
If you don't have this problem, I will be very surprised!
Thank you in advance for taking the time to look again.
--hm
You only need .NET from wherever you are sending the email not on the server - I just assumed you were doing this on your server FoxPro application.
+++ Rick ---
I'm running the VFP routing on my laptop. I would think all the code is executing on it and the only server in this case would be my mail server. In this case my version of Dot NET is 4.5. I will send you a screen shot offline.
Because your reply threw me a curve with the word "server" having dot net, I also looked at the system which the mail server sits on. Mind you this machine is strictly used for mail which is not Exchange so the need for dot NET has never come up before. It is running version 1.1 which I assume was installed at the time the machine was configured.
--hm
The default mode doesn't use .NET so you're going through a completely different pipeline to send emails.
If the .NET code doesn't work check for errors. Most likely you don't have .NET installed on your server.
+++ Rick ---
Discovered what was causing my problem although not sure why it does not work?
My setup code was the issue...
DO wwSmtp
LOCAL loSmtp as wwSmtp
loSmtp = CREATEOBJECT("wwSmtp")* loSmtp.nMailMode = 0 && .NET 2 - classic (default)
By commenting out the nMailMode = 0 which I understood used the .NET version of WC, o.SendMessage looping inside the o.Connect to o.Close now works fine.
Who knew... :-)
--hm
Jim,
I just double checked this on my machine.
Can you setup the wwSmtp_sample.prg in the wwIpstuff_samples folder by just modifying for your mail server setup? One of the options in that file (commented out by default) is to make two SendMessage calls in a row. I ran that code and I got two email messages. Please check with that code... I used GMail for testing as well as my ISP here in Hood River and it worked with both. Maybe if it doesn't work try using a GMail or other public account to see if that gives different results.
If that doesn't work I'm not sure. It could be some mail server compatibility issue...
+++ Rick ---
OK, the my error still seems to exist when trying to send using the following code. The first address from my mailing list table goes without any problems be 2-n all show Incomplete-Session in the server logs.
A bit about my environment... My mail server is on the same LAN as my routine below which is running from my laptop.
Here is my code (excluding SMTP setup):
DO wwSmtp
LOCAL loSmtp as wwSmtp*** setup smtp properties goes here along with opening table ***
SELECT('myList')
loSmtp.Connect()
SCAN* prevent from sending twice
IF NOT EMPTY(result)
LOOP
ENDIFloSmtp.cRecipient = ["] +ALLTRIM(STRTRAN(sender,',',' ')) + '" <' + ALLTRIM(email) +'>'
*loSmtp.cReplyTo = ALLTRIM(AcntName)
*** Now Sending ***
llResult = loSmtp.SendMessage()
* WAIT TIMEOUT .25
IF llResult
REPLACE Result WITH TRANSFORM(DATETIME())
ELSE
REPLACE Result WITH LEFT( loSmtp.cErrorMsg, 100)
ENDIFENDSCAN
loSmtp.Close()
I've left out all of the setup code for SMPT but basically copied and pasted in the sample code from the SendMessage documentation. And since the first message gets delivered correctly the problem is not in the configuration of SMTP.
Any help would be most welcome...
--hm--
There is a bug here with sending multiple messages with an attachment in .NET mode. It looks like when there's an attachment the first message sends subsequent ones do not.
For now the workaround is to use SendMail not SendMessage - ie. recreate the wwSmtp object for each send. I have to see what the issue is there - I don't see anything obvious wrong with this.
+++ Rick ---
When I copy and paste your example from the online documentation, the code works just fine.
Hum... something stinks like rotten fish!! <frown>
Then after another hour plus of comparing my code to your sample, I discovered one slight difference.
loSmtp.AddAttachment("C:\myFolder\myAcrobatFile.pdf","pdf/application")VS.
loSmtp.cAttachment = "C:\myFolder\myAcrobatFile.pdf"
What I've discovered is cAttachment works in both classic nMailMode and in dot NET. On the other hand, AddAttachment only works on the first message inside the loop when dot NET nMailMode is selected.
Bug or Feature?
....James@Cranky.com! <g>
--hm
I'm not sure what you're saying. in MailMode 0 you can just send messages and leave the connection open. That only works in .NET. The classic version will always open and close connections for everything.
+++ Rick ---
Then the error is real and you need to take another look!
Reminder....
SendMessage() where the loSmtp.Connect() is before the SCAN loop of email addresses to send and where the loSmtp.Close() is after the ENDSCAN.
If I Connect() and Close() within the scan loop using the dotNET provider, then it works fine. But not as your documentation suggests where connection is held open for the duration of the loop.
This error is reproducible by copying your code from the online documentation and only changing this one parameter
loSmtp.nMailMode = 0
If you don't have this problem, I will be very surprised!
Thank you in advance for taking the time to look again.
--hm
You only need .NET from wherever you are sending the email not on the server - I just assumed you were doing this on your server FoxPro application.
+++ Rick ---
I'm running the VFP routing on my laptop. I would think all the code is executing on it and the only server in this case would be my mail server. In this case my version of Dot NET is 4.5. I will send you a screen shot offline.
Because your reply threw me a curve with the word "server" having dot net, I also looked at the system which the mail server sits on. Mind you this machine is strictly used for mail which is not Exchange so the need for dot NET has never come up before. It is running version 1.1 which I assume was installed at the time the machine was configured.
--hm
The default mode doesn't use .NET so you're going through a completely different pipeline to send emails.
If the .NET code doesn't work check for errors. Most likely you don't have .NET installed on your server.
+++ Rick ---
Discovered what was causing my problem although not sure why it does not work?
My setup code was the issue...
DO wwSmtp
LOCAL loSmtp as wwSmtp
loSmtp = CREATEOBJECT("wwSmtp")* loSmtp.nMailMode = 0 && .NET 2 - classic (default)
By commenting out the nMailMode = 0 which I understood used the .NET version of WC, o.SendMessage looping inside the o.Connect to o.Close now works fine.
Who knew... :-)
--hm
Jim,
I just double checked this on my machine.
Can you setup the wwSmtp_sample.prg in the wwIpstuff_samples folder by just modifying for your mail server setup? One of the options in that file (commented out by default) is to make two SendMessage calls in a row. I ran that code and I got two email messages. Please check with that code... I used GMail for testing as well as my ISP here in Hood River and it worked with both. Maybe if it doesn't work try using a GMail or other public account to see if that gives different results.
If that doesn't work I'm not sure. It could be some mail server compatibility issue...
+++ Rick ---
OK, the my error still seems to exist when trying to send using the following code. The first address from my mailing list table goes without any problems be 2-n all show Incomplete-Session in the server logs.
A bit about my environment... My mail server is on the same LAN as my routine below which is running from my laptop.
Here is my code (excluding SMTP setup):
DO wwSmtp
LOCAL loSmtp as wwSmtp*** setup smtp properties goes here along with opening table ***
SELECT('myList')
loSmtp.Connect()
SCAN* prevent from sending twice
IF NOT EMPTY(result)
LOOP
ENDIFloSmtp.cRecipient = ["] +ALLTRIM(STRTRAN(sender,',',' ')) + '" <' + ALLTRIM(email) +'>'
*loSmtp.cReplyTo = ALLTRIM(AcntName)
*** Now Sending ***
llResult = loSmtp.SendMessage()
* WAIT TIMEOUT .25
IF llResult
REPLACE Result WITH TRANSFORM(DATETIME())
ELSE
REPLACE Result WITH LEFT( loSmtp.cErrorMsg, 100)
ENDIFENDSCAN
loSmtp.Close()
I've left out all of the setup code for SMPT but basically copied and pasted in the sample code from the SendMessage documentation. And since the first message gets delivered correctly the problem is not in the configuration of SMTP.
Any help would be most welcome...
West Wind Technologies
Making waves on the Web
from Maui
So this works in the sample:
#IF .T.
*** Must manually connect first
loSmtp.Connect()loSmtp.cAttachment = "c:\temp\trace.txt"
*** Send first recipient
?loSmtp.SendMessage("jjimy44@hotmail.com","","")
? loSmtp.cErrorMsg*** Send second recipient
*loSmtp.AddAttachment("c:\temp\trace.txt")
loSmtp.cAttachment = "c:\temp\trace.txt"
loSmtp.cSubject = "Message number two"
?loSmtp.SendMessage("jjimy55@hotmail.com","","")
? loSmtp.cErrorMsg*** Must close connection
loSmtp.Close()
#ENDIF
Looked to see and it appears this is a .NET issue that's not properly releasing the attachment object. And the actual attachment can't be reused more than once (so you can't create it and then use it again).
cAttachment just adds a new attachment each time so that works.
+++ Rick ---
When I copy and paste your example from the online documentation, the code works just fine.
Hum... something stinks like rotten fish!! <frown>
Then after another hour plus of comparing my code to your sample, I discovered one slight difference.
loSmtp.AddAttachment("C:\myFolder\myAcrobatFile.pdf","pdf/application")VS.
loSmtp.cAttachment = "C:\myFolder\myAcrobatFile.pdf"
What I've discovered is cAttachment works in both classic nMailMode and in dot NET. On the other hand, AddAttachment only works on the first message inside the loop when dot NET nMailMode is selected.
Bug or Feature?
....James@Cranky.com! <g>
--hm
I'm not sure what you're saying. in MailMode 0 you can just send messages and leave the connection open. That only works in .NET. The classic version will always open and close connections for everything.
+++ Rick ---
Then the error is real and you need to take another look!
Reminder....
SendMessage() where the loSmtp.Connect() is before the SCAN loop of email addresses to send and where the loSmtp.Close() is after the ENDSCAN.
If I Connect() and Close() within the scan loop using the dotNET provider, then it works fine. But not as your documentation suggests where connection is held open for the duration of the loop.
This error is reproducible by copying your code from the online documentation and only changing this one parameter
loSmtp.nMailMode = 0
If you don't have this problem, I will be very surprised!
Thank you in advance for taking the time to look again.
--hm
You only need .NET from wherever you are sending the email not on the server - I just assumed you were doing this on your server FoxPro application.
+++ Rick ---
I'm running the VFP routing on my laptop. I would think all the code is executing on it and the only server in this case would be my mail server. In this case my version of Dot NET is 4.5. I will send you a screen shot offline.
Because your reply threw me a curve with the word "server" having dot net, I also looked at the system which the mail server sits on. Mind you this machine is strictly used for mail which is not Exchange so the need for dot NET has never come up before. It is running version 1.1 which I assume was installed at the time the machine was configured.
--hm
The default mode doesn't use .NET so you're going through a completely different pipeline to send emails.
If the .NET code doesn't work check for errors. Most likely you don't have .NET installed on your server.
+++ Rick ---
Discovered what was causing my problem although not sure why it does not work?
My setup code was the issue...
DO wwSmtp
LOCAL loSmtp as wwSmtp
loSmtp = CREATEOBJECT("wwSmtp")* loSmtp.nMailMode = 0 && .NET 2 - classic (default)
By commenting out the nMailMode = 0 which I understood used the .NET version of WC, o.SendMessage looping inside the o.Connect to o.Close now works fine.
Who knew... :-)
--hm
Jim,
I just double checked this on my machine.
Can you setup the wwSmtp_sample.prg in the wwIpstuff_samples folder by just modifying for your mail server setup? One of the options in that file (commented out by default) is to make two SendMessage calls in a row. I ran that code and I got two email messages. Please check with that code... I used GMail for testing as well as my ISP here in Hood River and it worked with both. Maybe if it doesn't work try using a GMail or other public account to see if that gives different results.
If that doesn't work I'm not sure. It could be some mail server compatibility issue...
+++ Rick ---
OK, the my error still seems to exist when trying to send using the following code. The first address from my mailing list table goes without any problems be 2-n all show Incomplete-Session in the server logs.
A bit about my environment... My mail server is on the same LAN as my routine below which is running from my laptop.
Here is my code (excluding SMTP setup):
DO wwSmtp
LOCAL loSmtp as wwSmtp*** setup smtp properties goes here along with opening table ***
SELECT('myList')
loSmtp.Connect()
SCAN* prevent from sending twice
IF NOT EMPTY(result)
LOOP
ENDIFloSmtp.cRecipient = ["] +ALLTRIM(STRTRAN(sender,',',' ')) + '" <' + ALLTRIM(email) +'>'
*loSmtp.cReplyTo = ALLTRIM(AcntName)
*** Now Sending ***
llResult = loSmtp.SendMessage()
* WAIT TIMEOUT .25
IF llResult
REPLACE Result WITH TRANSFORM(DATETIME())
ELSE
REPLACE Result WITH LEFT( loSmtp.cErrorMsg, 100)
ENDIFENDSCAN
loSmtp.Close()
I've left out all of the setup code for SMPT but basically copied and pasted in the sample code from the SendMessage documentation. And since the first message gets delivered correctly the problem is not in the configuration of SMTP.
Any help would be most welcome...
West Wind Technologies
Making waves on the Web
from Maui
It'll be in the next update.
+++ Rick ---
When I copy and paste your example from the online documentation, the code works just fine.
Hum... something stinks like rotten fish!! <frown>
Then after another hour plus of comparing my code to your sample, I discovered one slight difference.
loSmtp.AddAttachment("C:\myFolder\myAcrobatFile.pdf","pdf/application")VS.
loSmtp.cAttachment = "C:\myFolder\myAcrobatFile.pdf"
What I've discovered is cAttachment works in both classic nMailMode and in dot NET. On the other hand, AddAttachment only works on the first message inside the loop when dot NET nMailMode is selected.
Bug or Feature?
....James@Cranky.com! <g>
--hm
I'm not sure what you're saying. in MailMode 0 you can just send messages and leave the connection open. That only works in .NET. The classic version will always open and close connections for everything.
+++ Rick ---
Then the error is real and you need to take another look!
Reminder....
SendMessage() where the loSmtp.Connect() is before the SCAN loop of email addresses to send and where the loSmtp.Close() is after the ENDSCAN.
If I Connect() and Close() within the scan loop using the dotNET provider, then it works fine. But not as your documentation suggests where connection is held open for the duration of the loop.
This error is reproducible by copying your code from the online documentation and only changing this one parameter
loSmtp.nMailMode = 0
If you don't have this problem, I will be very surprised!
Thank you in advance for taking the time to look again.
--hm
You only need .NET from wherever you are sending the email not on the server - I just assumed you were doing this on your server FoxPro application.
+++ Rick ---
I'm running the VFP routing on my laptop. I would think all the code is executing on it and the only server in this case would be my mail server. In this case my version of Dot NET is 4.5. I will send you a screen shot offline.
Because your reply threw me a curve with the word "server" having dot net, I also looked at the system which the mail server sits on. Mind you this machine is strictly used for mail which is not Exchange so the need for dot NET has never come up before. It is running version 1.1 which I assume was installed at the time the machine was configured.
--hm
The default mode doesn't use .NET so you're going through a completely different pipeline to send emails.
If the .NET code doesn't work check for errors. Most likely you don't have .NET installed on your server.
+++ Rick ---
Discovered what was causing my problem although not sure why it does not work?
My setup code was the issue...
DO wwSmtp
LOCAL loSmtp as wwSmtp
loSmtp = CREATEOBJECT("wwSmtp")* loSmtp.nMailMode = 0 && .NET 2 - classic (default)
By commenting out the nMailMode = 0 which I understood used the .NET version of WC, o.SendMessage looping inside the o.Connect to o.Close now works fine.
Who knew... :-)
--hm
Jim,
I just double checked this on my machine.
Can you setup the wwSmtp_sample.prg in the wwIpstuff_samples folder by just modifying for your mail server setup? One of the options in that file (commented out by default) is to make two SendMessage calls in a row. I ran that code and I got two email messages. Please check with that code... I used GMail for testing as well as my ISP here in Hood River and it worked with both. Maybe if it doesn't work try using a GMail or other public account to see if that gives different results.
If that doesn't work I'm not sure. It could be some mail server compatibility issue...
+++ Rick ---
OK, the my error still seems to exist when trying to send using the following code. The first address from my mailing list table goes without any problems be 2-n all show Incomplete-Session in the server logs.
A bit about my environment... My mail server is on the same LAN as my routine below which is running from my laptop.
Here is my code (excluding SMTP setup):
DO wwSmtp
LOCAL loSmtp as wwSmtp*** setup smtp properties goes here along with opening table ***
SELECT('myList')
loSmtp.Connect()
SCAN* prevent from sending twice
IF NOT EMPTY(result)
LOOP
ENDIFloSmtp.cRecipient = ["] +ALLTRIM(STRTRAN(sender,',',' ')) + '" <' + ALLTRIM(email) +'>'
*loSmtp.cReplyTo = ALLTRIM(AcntName)
*** Now Sending ***
llResult = loSmtp.SendMessage()
* WAIT TIMEOUT .25
IF llResult
REPLACE Result WITH TRANSFORM(DATETIME())
ELSE
REPLACE Result WITH LEFT( loSmtp.cErrorMsg, 100)
ENDIFENDSCAN
loSmtp.Close()
I've left out all of the setup code for SMPT but basically copied and pasted in the sample code from the SendMessage documentation. And since the first message gets delivered correctly the problem is not in the configuration of SMTP.
Any help would be most welcome...
West Wind Technologies
Making waves on the Web
from Maui