This is a read-only archive of the old Scratch 1.x Forums.
Try searching the current Scratch discussion forums.

#1 2010-08-20 13:34:11

celloguy123
Scratcher
Registered: 2009-01-15
Posts: 100+

E-Mail on Scratch

I got the code for sending e-mail from here, which is this:

SeptimusHeap wrote:

| message sender recipients |
message := 'From: Me <my.address@example.invalid>
To: You <your.address@another.invalid>
Subject: Simple Mail from Squeak

This is a test mail'.
sender := 'my.address@example.invalid'.
recipients := #('your.address@another.invalid').
SMTPClient
    deliverMailFrom: sender
    to: recipients
    text: message
    usingServer: 'name.of.mail.server'

If i changed it to

Code:

sendEmailFrom: t1 to: t2 subject: t3 body: t4 server: t5
     | message sender recipients |
     message := 'From: t1
     To: t2
     Subject: t3

     t4'.
     sender := t1
     recipients := #(t2).
     SMTPClient
         deliverMailFrom: sender
         to: recipients
         text: message
         usingServer: t4

, could i make a e-mail block?

Last edited by celloguy123 (2010-08-21 14:51:46)


http://internetometer.com/image/33068.png

Offline

 

#2 2010-08-20 14:25:38

bbbeb
Scratcher
Registered: 2009-06-11
Posts: 1000+

Re: E-Mail on Scratch

The easiest way to find out is to try it!


Back in my day.... there were no laws that censored the internet... now, there are.... nah.

Offline

 

#3 2010-09-01 12:52:29

celloguy123
Scratcher
Registered: 2009-01-15
Posts: 100+

Re: E-Mail on Scratch

sendEmailFrom: t1 to: t2 subject: t3 body: t4 server: t5
     | message sender recipients |
     message := 'From: t1
     To: t2
     Subject: t3

     t4'.
     sender := t1
     recipients Error: when I try to save it, it says right here, "Nothing more expected ->.":= #(t2).
     SMTPClient
         deliverMailFrom: sender
         to: recipients
         text: message
         usingServer: t4

Last edited by celloguy123 (2010-09-01 12:54:34)


http://internetometer.com/image/33068.png

Offline

 

#4 2010-09-01 12:57:55

SeptimusHeap
Scratcher
Registered: 2010-02-01
Posts: 1000+

Re: E-Mail on Scratch

squeak wiki wrote:

However, finding the name of the mail server is difficult. You need to look up an MX (Mail eXchange) record for the recipient domain with th DNS system, and Squeak does not provide an interface to that (which really is a pity).
That's the main reason why Squeak is wimping out and only delivers to a server address that you provide.
The other reason is that in theses days of spam and worms and viruses, many incoming mail servers don't accept mail from dynamic IP addresses anymore, so even if you find the MX for a given mail address, chances are good that it won't accept mail from you.

Does that help?


http://i46.tinypic.com/dw7zft.png

Offline

 

#5 2010-09-01 14:27:09

johnnydean1
Scratcher
Registered: 2010-02-12
Posts: 1000+

Re: E-Mail on Scratch

celloguy123 wrote:

sendEmailFrom: t1 to: t2 subject: t3 body: t4 server: t5
     | message sender recipients |
     message := 'From: t1
     To: t2
     Subject: t3

     t4'.
     sender := t1
     recipients := #(t2).
     SMTPClient
         deliverMailFrom: sender
         to: recipients
         text: message
         usingServer: t4


You can now reach me on Twitter @johnnydean1_

Offline

 

#6 2010-09-02 11:50:05

LS97
Scratcher
Registered: 2009-06-14
Posts: 1000+

Re: E-Mail on Scratch

didn't work. gave no errors, but the something could not be found. cant remeber what maybe server, recipient or client  hmm  probably yahoo doesnt accept them anymore

Offline

 

#7 2010-09-02 12:00:53

fg123
Scratcher
Registered: 2008-11-13
Posts: 1000+

Re: E-Mail on Scratch

You also have to enable SMTP for your email program.


Hai.

Offline

 

#8 2010-09-02 13:08:35

LS97
Scratcher
Registered: 2009-06-14
Posts: 1000+

Re: E-Mail on Scratch

^^i did< it4s the sq;e qccount i use for outlook

Offline

 

#9 2010-09-05 03:46:38

Daffy22
Scratcher
Registered: 2008-12-15
Posts: 500+

Re: E-Mail on Scratch

I know VBS can send email, so maybe you could make an email block that asks for subject, who to, and what the message is. Then it writes it to a VBS file and runs it. That should send an email?? Does that help? I might try that now.  smile


http://img201.imageshack.us/img201/1784/logosmalle.png
"Spectacular - 5 Star" -  CNET.com Editor.

Offline

 

Board footer