Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
EMail via ShellExecute (mailto) - limitations?
Message
From
01/03/2007 17:20:38
 
General information
Forum:
Visual FoxPro
Category:
Internet applications
Miscellaneous
Thread ID:
01200057
Message ID:
01200133
Views:
48
>>>>Is there a limit on how large the recipient list can be when sending an email via a shellexecute and mailto:? I can't seem to get past about 50 names. Is there a work around?
>>>
>>>You shouldn't put 50 names into a recipient list anyway. Your mail is very likely to bounce when you do as spam.
>>
>>Good point. Thank you. I'll try and write a loop that sends them individually.
>
>I think you can bcc several people at once. I'm sending e-mails to "friends and relatives" group using this option.

I suppose what I'm needing to do is something akin to a listserv. There will be a couple hundred recipients and attachments. I'm using a routine that I think I got from you a couple of years agobased on something Rick Strahl had written up.
******************************************************************************
*	Procedure file: SENDEMAIL.PRG
******************************************************************************
*	Calls the user's default email client and passes the recipient's email address,
*   email subject, and email textbody.
* 	The email client is launched but the user must manually click on SEND.
* 	Based on whitepapers from http://www.west-wind.com/articles.asp
******************************************************************************
* Example Use:
* sendemail('myemail@mymailserver.com','Subject Line','Text body of message')
******************************************************************************
*
lparameters tcRecipient,tcSubject,tcBody

return GoSite("mailto:" + tcRecipient + ;
	"&Subject=" +strtran(UrlEncode(tcSubject),"+"," ") +;
	"&Body=" + strtran(UrlEncode(tcBody),"+"," "))


*----------------------------------------------------------------
function GoSite(tcUrl, tcAction, tcDirectory, tcParms)

if empty(tcUrl)
	return -1
endif

if empty(tcAction)
	tcAction = "OPEN"
endif

if empty(tcDirectory)
	tcDirectory = sys(2023)
endif

if empty(tcParms)
	tcParms = ""
endif

declare integer ShellExecute ;
	in SHELL32.dll ;
	integer nWinHandle,;
	string cOperation,;
	string cFileName,;
	string cParameters,;
	string cDirectory,;
	integer nShowWindow

declare integer FindWindow ;
	in WIN32API string cNull,string cWinName

return ShellExecute(FindWindow(0,_screen.caption),;
	tcAction,tcUrl,;
	tcParms, tcDirectory,1)

*------------------------------------------------------------------
function UrlEncode( tcValue, llNoPlus )

local lcResult, lcChar, lnSize, lnX
lcResult=""

for lnX=1 to len(tcValue)
	lcChar = substr(tcValue,lnX,1)
	if atc(lcChar,"ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789") > 0
		lcResult=lcResult + lcChar
		loop
	endif

	if lcChar=" " and !llNoPlus
		lcResult = lcResult + "+"
		loop
	endif

*** Convert others to Hex equivalents
	lcResult = lcResult + "%" + right(transform(asc(lcChar),"@0"),2)
endfor
return lcResult
Look familiar?

Do you know if this technique can handle attachments? And if so, how?
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform