Hola dickies. Si entiendo bien, deberías hacer esto más o menos:
- En tu html tendrás un formulario que tienes que enviar por método POST por ejemplo. Pasas por POST al php la variable con el producto a reservar.
- Desde el script de envío de correo rescatas esa variable POST y envías el mail.
Código para enviar mail:
Código php:
Ver original<?php
require_once dirname(__FILE__) . '/config.php'; require_once 'lib/swift_required.php';
require_once "lib/classes/Swift.php";
//Create the Transport the call setUsername() and setPassword()
$transport = Swift_SmtpTransport::newInstance('TUSERVIDORSMTP', 25)
->setUsername('TUUSUARIO')
->setPassword('TUCONTRASEÑA')
;
//Create the Mailer using your created Transport
$mailer = Swift_Mailer::newInstance($transport);
//Create the message
$message = Swift_Message::newInstance()
//Give the message a subject
->setSubject('ELASUNTO')
//Set the From address with an associative array
->setFrom(array('DIRECCIONDESDELAQUESEENVIA' => 'NOMBREREMITENTE')) //Set the To addresses with an associative array
->setTo(array('DIRECCIONDESTINATARIO1','DIRECCIONDESTINATARIO2')) //Give it a body
->setBody('TEXTODELMENSAJE')
//And optionally an alternative body
//->addPart('<q>Here is the message itself</q>', 'text/html')
//Optionally add any attachments
->attach(Swift_Attachment::fromPath('gpclub_a.xls'))
;
//Send the message
$numSent = $mailer->send($message);
printf("Enviados %d Mensajes\n", $numSent); ?>