Featured post

c# - Usage of Server Side Controls in MVC Frame work -

i using asp.net 4.0 , mvc 2.0 web application. project requiremrnt have use server side control in application not possibl in noraml case. ideally want use adrotator control , datalist control. i saw few samples , references in codepleax mvc controllib howwver found less useful. can tell how utilize theese controls in asp.net application along mvc. note: please provide functionalities related adrotator , datalist controls not equivalent functionalities thanks in advace. mvc pages not use normal .net solution makes use of normal .net components impossible. a normal .net page use event driven solution call different methods service side mvc use actions , view completly different way handle things. also, mvc not use viewstate normal .net controlls require. found article discussing mixing of normal .net , mvc.

sendmail - Send Mail using PHP failing -


i using same php code have used try , send form via email , getting message:

warning: mail() [function.mail]: failed connect mailserver @ "localhost" port 25, verify "smtp" , "smtp_port" setting in php.ini or use ini_set() in sendmailsuscribete.php on line 44

this lines 40 - 54:

$header .= "from: $email" . "\r\n"; $header .= "reply-to: $email" . "\r\n"; $header .= "return-path: $email" . "\r\n";  if(mail($to, $subject, $msg, $header)){     //message sent!     redirect("http://www.domain.com/suscribete.html"); }else{     // display error message if message failed send     echo "     <div class=\"msgerror\">         <h1>error&hellip;</h1>         <p>disculpa <b><?=$name;?></b>, tu mensaje fall&oacute; en ser enviado. por favor vuelve intentar.</p> </div>"; } 

i checked using phpinfo() , know smtp set localhost , port uses 25 have no idea error may be.

update forgot running on windows server , php file 1 i've used unix servers, should contain different?

mail cannot send e-mails directly (at least not on windows), needs smtp server. there no smtp server running on host on php-script being executed. solutions are:

  1. use library can send e-mails directly using smtp, phpmailer or swiftmailer (github repo).
  2. edit php.ini directives point smtp server accepts e-mails you. ask hosting provider if not know 1 use.
  3. set smtp server on localhost.

point 1. idea, because libraries provide abstractions make unnecessary deal low level stuff putting mime messages correctly. point 2. least trouble. advice against point 3. unless serious administering e-mail server yourself.


Comments

Popular posts from this blog

c# - Usage of Server Side Controls in MVC Frame work -

cocoa - Nesting arrays into NSDictionary object (Objective-C) -

ios - Very simple iPhone App crashes on UILabel settext -