Warning: require_once(swift-mailer/lib/swift_required.php) [function.require-once]: failed to open stream: No such file or directory in /srv/disk7/t.net/procesar.php on line 9
Fatal error: require_once() [function.require]: Failed opening required 'swift-mailer/lib/swift_required.php' (include_path='.:/usr/local/php5/share/pear') in /srv/disk7/t.net/procesar.php on line 9
El hosting y el dominio soportan PHP, formulario de consulta desde HTML5 a php.
Haber si alguien me puede echar un cable
Código PHP:
<?php
$server = 'smtpout.secureserver.net';
$user = 'accountid.website';
$pass = 'password';
$from = '[email protected]';
$to = '[email protected]';
//Load in the files we'll need
require_once 'swift-mailer/lib/swift_required.php';
//Create a Swift transport and mailer
$transport = Swift_SmtpTransport::newInstance($server, 80)
->setUsername($user)
->setPassword($pass);
$mailer = Swift_Mailer::newInstance($transport);
$body = "test test test";
$html = "<p>Optionally, <b>send an HTML version of the message</b></p><pre>$body</pre>";
//Create the message
$message = Swift_Message::newInstance()
->setSubject('Swiftmailer (lib version 4x) test')
->setFrom(array('[email protected]' => 'test script on webserver'))
->setTo(array(
'[email protected]' => 'Fred Nerk',
'[email protected]' => "Someone Else"
))
->setBody($body)
->addPart($html, 'text/html')
;
//You can leave out the 'addPart' line if you only want to send a plain text email.
if ($mailer->send($message)) {
echo "Sent";
} else {
echo "Failed";
}
$para = 'email';
$asunto = $_POST["tipo"];
$mailheader = "From: ".$_POST["email"]."\r\n";
$mailheader .= "Reply-To: ".$_POST["email"]."\r\n";
$mailheader .= "Content-type: text/html; charset=iso-8859-1\r\n";
$MESSAGE_BODY = "Nombre: ".$_POST["nombre"]."<\n>";
$MESSAGE_BODY .= "Email: ".$_POST["email"]."<\n>";
$MESSAGE_BODY .= "Telefono: ".$_POST["telefono"]."<\n>";
$MESSAGE_BODY .= "Tipo de contacto: ".$_POST["tipo"]."<\n>";
$MESSAGE_BODY .= "Mensaje: ".nl2br($_POST["mensaje"])."<\n>";
header( 'Location: http://t.net/gracias.html' )
?>