Sending email with Run BASIC

new BookmarkLockedFalling
carlgundel
Administrator
*****
Creator of Run BASIC

carlgundel Avatar

Posts: 975

Post by carlgundel on Jun 7, 2008 9:38:34 GMT -5

Scott and I have added an email sending object to Run BASIC called smtpsender. Here is a quick example of how you would use it to send an email message:

mailServer$ = "mail.myserver.com"
pword$ = "donuts321"
fromAddr$ = "carlg@libertybasic.com"
toAddr$ = "user@gmail.com"
subject$ = "Do you want some Pi?"
text$ = "Yes please. With vanilla ice cream!"

smtpsender #aSender, mailServer$
#aSender password(pword$)
#aSender send(fromAddr,ドル toAddr,ドル subject,ドル text$)

Last Edit: Jun 7, 2008 9:38:56 GMT -5 by carlgundel
mackrackit
Full Member
***

mackrackit Avatar

Posts: 231

Dave[br][br][url]http://www.mackrackit.com:8888[/url][br]
StefanPendl
Global Moderator
*****

StefanPendl Avatar

Run for BASIC ...
Posts: 945

[b]Stefan[/b] - [a href=http://stefanpendl.runbasichosting.com/]Homepage[/a][br][br][b]Please give credit if you use code I post, no need to ask for permission.[/b][br][br]Run BASIC 1.01, Fire-/Waterfox (IE11, Edge), Windows 10 Professional x64, Intel Core i7-4710MQ 2.5GHz, 16GB RAM
Jerry Muelver
Administrator
*****

Jerry Muelver Avatar

Posts: 521

turbov21
Guest

Guest Avatar

Carl Gundel - admin
Administrator
*****

Carl Gundel - admin Avatar

Posts: 550

turbov21
Guest

Guest Avatar

Carl Gundel - admin
Administrator
*****

Carl Gundel - admin Avatar

Posts: 550

Post by Carl Gundel - admin on Jun 11, 2008 21:35:57 GMT -5

turbov21 Avatar
Carl Gundel - admin Avatar
As soon as I can get a round tuit. ;)


Well, I'll see if I can find you a Round Tuit on eBay if that's what it'll take. :)

Well, your request has encouraged me to do some research on HTTP POST, so I hope to be able to deliver this functionality in the very near future.

-Carl
turbov21
Guest

Guest Avatar

Post by turbov21 on Jun 13, 2008 9:42:02 GMT -5

Carl Gundel - admin Avatar
Well, your request has encouraged me to do some research on HTTP POST, so I hope to be able to deliver this functionality in the very near future.

-Carl


I appreciate it, Carl! Being able to POST to other services will fill in the last piece of the puzzle for turning RB into an even more powerful tool for plugging systems together. Thank you!
Carl Gundel - admin
Administrator
*****

Carl Gundel - admin Avatar

Posts: 550

Post by Carl Gundel - admin on Jun 14, 2008 15:33:13 GMT -5

turbov21 Avatar
Carl Gundel - admin Avatar
Well, your request has encouraged me to do some research on HTTP POST, so I hope to be able to deliver this functionality in the very near future.

-Carl


I appreciate it, Carl! Being able to POST to other services will fill in the last piece of the puzzle for turning RB into an even more powerful tool for plugging systems together. Thank you!

Seems to me we will ultimately need to be fancier, but how does the following syntax look?

url$ = "http://someplace.com"
postThis$ = "first=something&second=somethingelse"
response$ = httpput$(url,ドル postThis$)

Can you think of a publicly available resource I can test against for this functionality?

-Carl
mikeukmid
Guest

Guest Avatar

carlgundel
Administrator
*****
Creator of Run BASIC

carlgundel Avatar

Posts: 975

Post by carlgundel on Jun 14, 2008 16:27:45 GMT -5

mikeukmid Avatar
Testing HTTP post. Will this do the job?

www.snee.com/xml/crud/posttest.html

Mike.

Hey Mike,

Just tried it specifying fname=Carl&lname=Gundel and it responded with the source code for the page. No indication that it did anything interesting with the data I posted so it's hard to tell if it actually worked.

I was playing with the following also, with better success except that the response then wanted me to post so some other URL to prove I am not a bot.

www.house.gov/
state=MAMassachusetts&zip=01721&zip4=1238

-Carl
mikeukmid
Guest

Guest Avatar

mikeukmid
Guest

Guest Avatar

Post by mikeukmid on Jun 16, 2008 10:15:50 GMT -5

Carl,
Back on-line after losing broadband service for many hours...

This is what is returned by the quoted posttest url from a test form. Your httpput$() function should be able to replicate this??

posted data
First name: "joe"

Last name: "bloggs"

REQUEST_URI: "/xml/crud/posttest.cgi"

QUERY_STRING: ""

CONTENT_LENGTH: "22"

content passed via STDIN: "fname=joe&lname=bloggs"


Mike.
turbov21
Guest

Guest Avatar

Post by turbov21 on Jun 16, 2008 12:42:54 GMT -5

Carl Gundel - admin Avatar
Can you think of a publicly available resource I can test against for this functionality?

-Carl


If you like, I can write a small PHP script that accepts POST'ed data and returns the key/value pairs as text. Would that be what you need?

EDIT: At the risk of underestimating the internal complexity of RunBASIC, would httppost$() command be built on the VisualWorks Smalltalk "HttpRequest" object?
Last Edit: Jun 16, 2008 12:52:25 GMT -5 by turbov21