Script Library: 1247 scripts
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search
 

Archive version of: massmailer.r ... version: 1 ... crazyaxe 30-Sep-2009

Amendment note: new script || Publicly available? Yes

Rebol [title: "Mass mailer"
	version: 0.1.2
	author: "Massimiliano Vessi"
	date:  29/9/2009
	email: maxint@tiscali.it
	 file: %massmailer.r
	Purpose: {"Mass emailng the world!"}
	;following data are for www.rebol.org library
	;you can find a lot of rebol script there
 	library: [ 
		level: 'beginner 
		platform: 'all 
		type: [tutorial tool] 
		domain: [scientific vid gui] 
		tested-under: [windows linux] 
		support: none 
		license: [gpl] 
		see-also: none 
		] 

	]
header-script: system/script/header

version: "Version: "
append version header-script/version



config: array 8


either exists? %mass_mailer_conf.txt [
	config: parse read %mass_mailer_conf.txt none
	] [
	alert "You must set access data. Please fill in data in Settings panel."
	]

configurazione_lay: layout [
	across
	title "Settings"
	return
	text "Your email:"
	email_fl: field  
	return
	text "SMTP server:"
	smtp_fl: field  
	return
	text "SMTP user:"
	smtpuser_fl: field
	return
	text "SMTP password:"
	smtppass_fl: field 
	return
	button "Save" [
		poke config 1  to-email email_fl/text    
		poke config 2  to-url smtp_fl/text
		poke config 7 to-string smtpuser_fl/text
		poke config 8  to-string smtppass_fl/text
		write %mass_mailer_conf.txt " "
		foreach item config [
			write/append %mass_mailer_conf.txt item
			write/append %mass_mailer_conf.txt newline
			]
		unview]
	button "Exit" [unview]	
	]

aiuto_lay: layout [
	title "HELP"
	text 180 {This is a mass email, it permits to send any number of emails without problems. It will send an email each 2 seconds. 
	If you'll fill correctly settings panel, all will be alright. File loaded by Mass mailer must be in ASCII not in unicode. 
	This program do his best with HTML email body. If you have problems, please contact me: maxint@tiscali.it }
	]


view layout [
	across
	title "Mass mailing"
	return
	button "Settings" [
		
		email_fl/text: to-string config/1
		smtp_fl/text:  to-string config/2
		smtpuser_fl/text: to-string config/7	
		 smtppass_fl/text: to-string config/8
		show [email_fl  smtp_fl smtpuser_fl smtppass_fl ]
		view/new configurazione_lay
		]
	return
	led1: led
	text "Subject:"
	oggetto: field "subject" [led1/data: true
		show led1]
	return
	led2: led
	button "Body message" [ 
		corpo_ind: request-file 
		a_lay/text: to-string corpo_ind
		show a_lay
		testo: read/string to-file corpo_ind
		led2/data: true
		show led2
		]
	a_lay: field "no text file loaded, html files are the best!"
	return
	led3: led
	button "Email list" [
		temp:  to-file request-file
		db_mail: read temp
		db_mail:  parse db_mail none
		sort db_mail 
		db_mail2: copy unique db_mail
		b_lay/text: to-string temp
		show b_lay
		led3/data: true
		show led3
		]
	b_lay: field "no email list file loaded"
	return
	button red "MASS MAILING!" [
		set-net  config
		il_header: make object! [   
			Content-Type: "text/html; charset=ISO-8859-15"
			X-REBOL: "View 2.7.6.3.1 http://WWW.REBOL.COM"
			Subject:  to-string oggetto/text
			From:   to-email config/1
			Return-Path: to-email config/1
			To: to-email config/1
			Date: reform [now/date now/time]
			]
		counter: 0
		b: length? db_mail2
		alert reform ["You are going to send" b "emails. I already deleted double entries. ;) "]
		foreach record db_mail2 [ 
			il_header/To:  record
			counter: counter + 1
			flash_1: flash reform ["Sending email n." counter]
			send/header     ( to-email record )    testo   il_header
			wait 2
			unview flash_1
			]
		alert reform ["Finished! You sent" counter "emails."]
		]
	btn-help [ view/new aiuto_lay]	
	return	
	text version	
	]

;ARGUMENTS:
;settings -- [email-addr default-server pop-server proxy-server proxy-port-id proxy-type esmtp-user esmtp-pass] (Type: block)
Notes