Fixing bugs...
This commit is contained in:
parent
5dc5c3ebe8
commit
f7579db9e8
24 changed files with 127 additions and 94 deletions
|
@ -16,7 +16,7 @@
|
|||
<center>
|
||||
<table summary="LuaSocket logo">
|
||||
<tr><td align=center><a href="http://www.lua.org">
|
||||
<img border=0 alt="LuaSocket" src="luasocket.png">
|
||||
<img width=128 border=0 alt="LuaSocket" src="luasocket.png">
|
||||
</a></td></tr>
|
||||
<tr><td align=center valign=top>Network support for the Lua language
|
||||
</td></tr>
|
||||
|
@ -165,7 +165,7 @@ If successful, the function returns 1. Otherwise, the function returns
|
|||
<p class=note>
|
||||
Note: SMTP servers are can be very picky with the format of e-mail
|
||||
addresses. To be safe, use only addresses of the form
|
||||
"<tt><fulano@tecgraf.puc-rio.br></tt>" in the <tt>from</tt> and
|
||||
"<tt><fulano@example.com></tt>" in the <tt>from</tt> and
|
||||
<tt>rcpt</tt> arguments to the <tt>send</tt> function. In headers, e-mail
|
||||
addresses can take whatever form you like. </p>
|
||||
|
||||
|
@ -238,23 +238,23 @@ and
|
|||
local smtp = require("smtp")
|
||||
|
||||
-- Connects to server "localhost" and sends a message to users
|
||||
-- "fulano@tecgraf.puc-rio.br", "beltrano@tecgraf.puc-rio.br",
|
||||
-- and "sicrano@tecgraf.puc-rio.br".
|
||||
-- "fulano@example.com", "beltrano@example.com",
|
||||
-- and "sicrano@example.com".
|
||||
-- Note that "fulano" is the primary recipient, "beltrano" receives a
|
||||
-- carbon copy and neither of them knows that "sicrano" received a blind
|
||||
-- carbon copy of the message.
|
||||
from = "<luasocket@tecgraf.puc-rio.br>"
|
||||
from = "<luasocket@example.com>"
|
||||
|
||||
rcpt = {
|
||||
"<fulano@tecgraf.puc-rio.br>",
|
||||
"<beltrano@tecgraf.puc-rio.br>",
|
||||
"<sicrano@tecgraf.puc-rio.br>"
|
||||
"<fulano@example.com>",
|
||||
"<beltrano@example.com>",
|
||||
"<sicrano@example.com>"
|
||||
}
|
||||
|
||||
mesgt = {
|
||||
headers = {
|
||||
to = "Fulano da Silva <fulano@tecgraf.puc-rio.br>",
|
||||
cc = '"Beltrano F. Nunes" <beltrano@tecgraf.puc-rio.br>',
|
||||
to = "Fulano da Silva <fulano@example.com>",
|
||||
cc = '"Beltrano F. Nunes" <beltrano@example.com>',
|
||||
subject = "My first message"
|
||||
}
|
||||
body = "I hope this works. If it does, I can send you another 1000 copies."
|
||||
|
@ -334,8 +334,8 @@ local ltn12 = require("ltn12")
|
|||
source = smtp.message{
|
||||
headers = {
|
||||
-- Remember that headers are *ignored* by smtp.send.
|
||||
from = "Sicrano de Oliveira <sicrano@tecgraf.puc-rio.br>",
|
||||
to = "Fulano da Silva <fulano@tecgraf.puc-rio.br>",
|
||||
from = "Sicrano de Oliveira <sicrano@example.com>",
|
||||
to = "Fulano da Silva <fulano@example.com>",
|
||||
subject = "Here is a message with attachments"
|
||||
},
|
||||
body = {
|
||||
|
@ -378,8 +378,8 @@ source = smtp.message{
|
|||
|
||||
-- finally send it
|
||||
r, e = smtp.send{
|
||||
from = "<sicrano@tecgraf.puc-rio.br>",
|
||||
rcpt = "<fulano@tecgraf.puc-rio.br>",
|
||||
from = "<sicrano@example.com>",
|
||||
rcpt = "<fulano@example.com>",
|
||||
source = source,
|
||||
}
|
||||
</pre>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue