User Control Panel
Advertisements
HELP US, HELP YOU!
Author
Message
mathieu2005 Young One Joined: 23 Dec 2004Posts: 76
Posted: Sat Mar 12, 2005 3:00 am Post subject:
Hey all, i just have a idea that is like sending mail in the convo like Code: if ($msg =~/^!sendmail (.*) - (.*) - (.*) - (.*)/){<br />$1 = email of the sender<br />$2 = password of the sender<br />$3 = the subject<br />$4 = The message
But i dont know if i can. Is nice to see you answer me (thx before). Bye
Back to top
Addict Not Yet a God Joined: 21 Jan 2004Posts: 473
Posted: Sat Mar 12, 2005 3:19 am Post subject:
Use Mail::Sendmail for this, it's really easy. Like this: Code: use Mail::Sendmail;<br />my($to,$message,$subject)=($1,$2,$3);<br /> my %mail = ( To => $to,<br /> From => $username,<br /> Message => $message,<br /> Subject => $subject,<br /> SMTP => 'mail.tcsbot.com:26',<br /> );<br /><br /> sendmail(%mail);<br />$self->sendMessage("OK. Send fine");
I havnt made it into a command, so you'll have to work that out yourself.
Back to top
draget Not Yet a God Joined: 29 Dec 2004Posts: 367 Location: Australia
Posted: Sat Mar 12, 2005 4:08 am Post subject:
if you meant bot-mail sorta thing, someone wrote a command ages ago. search!
Back to top
M4RTIN Member Joined: 31 Dec 2004Posts: 134
Posted: Sat Mar 12, 2005 8:00 am Post subject:
Isn't there a SendMail Module
Back to top
Mojave Almost An Agent Joined: 01 Nov 2003Posts: 1434
Posted: Sat Mar 12, 2005 8:58 am Post subject:
Quote: Isn't there a SendMail Module
Hmm, guess you didn't bother to look at TCS's code.
Back to top
M4RTIN Member Joined: 31 Dec 2004Posts: 134
Posted: Sat Mar 12, 2005 9:30 am Post subject:
:\ sorry, Didn't think before I posted.
Back to top
Dazzy Agent Joined: 09 Jan 2004Posts: 1731
Posted: Sat Mar 12, 2005 12:08 pm Post subject:
Is there a hotmail or another more public server?
Back to top
M4RTIN Member Joined: 31 Dec 2004Posts: 134
Back to top
Dazzy Agent Joined: 09 Jan 2004Posts: 1731
Posted: Sat Mar 12, 2005 2:42 pm Post subject:
Hmm, i dont think thats valid in this command Code: connect to localhost failed (Unknown error) no (more) retries!
Back to top
M4RTIN Member Joined: 31 Dec 2004Posts: 134
Posted: Sat Mar 12, 2005 3:02 pm Post subject:
Hrrm, Not sure why then. ;\
Back to top
Cer Upgraded Agent Joined: 03 Feb 2004Posts: 3776 Location: Michigan votes : 4
Posted: Sat Mar 12, 2005 6:32 pm Post subject:
QUOTE(Dazzy @ Mar 12 2005, 09:42 AM)
Hmm, i dont think thats valid in this command
Code: connect to localhost failed (Unknown error) no (more) retries!
[right][snapback]46812[/snapback][/right]
Did you specify the SMTP server? (it's "Smtp", not "SMTP", TCS ). $mail{Smtp} = 'mail.mydomain.com'; _________________ Current Site (2008) http://www.cuvou.com/
Back to top
Dazzy Agent Joined: 09 Jan 2004Posts: 1731
Posted: Sat Mar 12, 2005 6:46 pm Post subject:
Code: <br />use Mail::Sendmail;<br />sub email {<br /> my ($bot,$self, $user, $name, $msg, $color) = @_;<br /><br /> my ($to,$message,$subject) = split("/",$msg,3);<br /><br /> if(!defined $message || !defined $subject || $to !~ /\@/ && $to !~ /\./){<br /> return "[Error]Wrong format...Like this:\n!email <to>/<message>/<subject>";<br /> }<br /> else{<br /> $message .= "\n\n->This email message was sent via the evolution template!";<br /><br /> my %mail = ( To => $to,<br /> From => $user,<br /> Message => $message,<br /> Subject => "Email from Evolution : $subject",<br /> Smtp => 'http://services.msn.com/svcs/hotmail/httpmail.asp',<br /> );<br /> sendmail(%mail);<br /> return "Ok, I've send the email...They should be recieving it any time now:)";<br /> <br /> }<br />}<br />
Yet i still get the same error and the email doesnt come
Back to top
Mojave Almost An Agent Joined: 01 Nov 2003Posts: 1434
Posted: Sat Mar 12, 2005 7:42 pm Post subject:
You should check for Sendmail errors: Code: my $success = Mail::Sendmail::sendmail(%mail);<br />if( !$success )<br />{<br /> print "Error: " . $Mail::Sendmail::error );<br />}
Back to top
draget Not Yet a God Joined: 29 Dec 2004Posts: 367 Location: Australia
Posted: Sun Mar 13, 2005 4:19 am Post subject:
Hotmail isn't SMPT. It uses HTTP-mail.
Back to top
Cer Upgraded Agent Joined: 03 Feb 2004Posts: 3776 Location: Michigan votes : 4
Posted: Mon Mar 14, 2005 1:15 am Post subject:
QUOTE(Dazzy @ Mar 12 2005, 01:46 PM)
Yet i still get the same error and the email doesnt come
[right][snapback]46820[/snapback][/right]
Something you should note, if the SMTP server is invalid it will assume localhost. If the SMTP server IS valid, it will try twice with it and then try a few times with localhost, i.e. Quote: connect to aichaos.com failed (Unknown error) connect to aichaos.com failed connect to aichaos.com failed (Unknown error) no (more) retries connect to localhost failed (Unknown error) connect to localhost failed connect to localhost failed (Unknown error) no (more) retries
I think it makes one more try at localhost than it does at the SMTP, but that's what the error kinda looks like if you actually have a valid SMTP server. If you run your bot from your own computer, why not run a local SMTP server?http://www.softstack.com/freesmtp.html _________________ Current Site (2008) http://www.cuvou.com/
Back to top