1 package require TclCurl
3 # As an example this is contrived, but it works.
7 "Date: Mon, 12 Sep 2011 20:34:29 +0200
8 To: fandom@telefonica.net
12 The body of the message starts here.
14 It could be a lot of lines, could be MIME encoded, whatever.
18 proc sendString {size} {
19 global alreadySent mailToSend
21 set toSend [string range $mailToSend $alreadySent [incr $alreadySent $size]]
23 incr alreadySent [string length $toSend]
28 set curlHandle [curl::init]
30 $curlHandle configure -url "smtp://smtp.telefonica.net:25"
32 $curlHandle configure -username "fandom\$telefonica.net"
33 $curlHandle configure -password "XXXXXXXX"
35 $curlHandle configure -mailfrom "fandom@telefonica.net"
36 $curlHandle configure -mailrcpt [list "fandom@telefonica.net" "andresgarci@telefonica.net"]
38 # You could put the mail in a file and use the '-infile' option
39 $curlHandle configure -readproc sendString
41 $curlHandle configure -verbose 1