mIRC Mailer (Works with PHP's sendmail)

By humming_hi on Oct 29, 2007

Load the Snippet into Remotes section of mIRC
What it does: Lets you send email useing sockets and PHP sendmail.
to use: /mail or right click in channel, status, or query windows
Needed PHP script: http://www.hawkee.com/snippet/3465/
(PS, I did not rip this. On IRC servers I go be the nickname Syrus)

/*
mIRC Mailer By: Syrus
Load into Remotes section of mIRC
to use: /mail or right click in channel, status, or query windows
needed PHP script: http://www.hawkee.com/snippet/3465/
*/

menu channel,status,query {
  Email:if (!$dialog(mail)) dialog -mdo mail mail
}
on *:sockopen:email:{
  sockwrite -n $sockname GET $+(/mircemail.php?,%e.mail,&email=,%e.email) HTTP/1.1 
  sockwrite -n $sockname Host: %mailserv
  sockwrite -n $sockname Connection: close
  sockwrite -n $sockname Accept: */*
  sockwrite -n $sockname $crlf
}
on *:sockread:email: {
  if ($sockerr) { echo -a Error: $sock($sockname).wsmsg }
  var %email.chk | sockread %email.chk
  if (!window(@email)) window -k0 @email
  if (*succ*sent* iswm %email.chk) { email.sent }
  elseif (*406 Not* iswm %email.chk) { email.fail }
  elseif (*failed* iswm %email.chk) { email.fail }
}
alias email.sent {
  rline @email 1 Message successfully sent!
  - | aline @email Message Sent To: %e.to 
  - | aline -p @email Subject: %e.sub
  - | aline -p @email Message: %e.msg
  unset %e.*
}
alias email.fail { rline @email 1 Message delivery failed... | unset %e.* }
alias -l - { aline @email $str($chr(149),30) }
menu @email {
  &Send Another:if (!$dialog(mail)) dialog -mdo mail mail
  &Clear/Save
  .&Clear:{ dline $active 1- }
  .&Save:{ filter -wf $active $replace($+($$?="Save As: ",.txt),$chr(32),_) }
}
dialog mail {
  title "mIRC Mailer (By: Syrus)"
  size -1 -1 298 248
  option pixels
  edit "To: (Friends Email)", 1, 5 19 287 20, center %e.to
  edit "From: (Your Email)", 2, 5 -1 287 21, center %e.email
  edit "Your Name", 3, 5 57 287 20, center %e.name
  edit "Subject", 6, 5 38 287 20, center %e.sub
  edit "Message", 8, 5 79 287 120, multi center %e.msg
  button "Cancel", 9, 225 200 65 25
}
on *:dialog:mail:sclick:9: { dialog -c mail }
on *:dialog:mail:sclick:10: { window -k0 @email | dline @email 1-
  if (!%mailserv) set %mailserv $$?"Enter the address to your mail server (where the PHP file is hosted, 'myweb.com')"
  if (!%mkey) set %mkey $$?"Enter the key you used in your PHP script"
  dialog -c mail | mail.send
}
alias mail.send {
  set %e.mail $+(key=,%mkey,&to=,$replace(%e.to,@,$+($chr(37),40)),&subject=,$replace(%e.sub,$chr(32),$+($chr(37),20)),&body=,$replace(%e.msg,$chr(32),$+($chr(37),20)),&name=,$replace(%e.name,$chr(32),$+($chr(37),20)))
  if (%e.mail) sockopen email %mailserv 80 | aline @email Email Being Sent
}

Comments

Sign in to comment.
humming_hi   -  Oct 30, 2007

Yea, I was thinking that. done now.

 Respond  
Pass   -  Oct 29, 2007

I\'d recommend posting one as a PHP snippet and one as a mIRC snippet, then link to each other on both pages. It\'d probably be a bit less confusing for newer users.

 Respond  
Are you sure you want to unfollow this person?
Are you sure you want to delete this?
Click "Unsubscribe" to stop receiving notices pertaining to this post.
Click "Subscribe" to resume notices pertaining to this post.