Answer the question
In order to leave comments, you need to log in
How to implement applications from the site for the landing page?
There is a site on html + javascript.
It is necessary to implement sending an application from the site to my mail. Mail php worked at first (and did not touch anything in the settings), today it no longer works.
What are the options for implementing this then?
I understand that you can't do without php? Or are there other handlers?
The question is lit.
Necessarily - there is a ready-made body (the application form itself) and you cannot change it.
Answer the question
In order to leave comments, you need to log in
If without checks and as briefly as possible, this is the code that sends the code to the email, the application fields are obtained from $_POST['Field_name']
$mail="[email protected]";
$subject="отправка сообщения";
$message .= "Текст сообщения\n \n".$_POST['name'];
if(mail ($mail,$subject,$message,"Content-type:text/plain; charset = UTF-8")) return " <h3 class='text-center'>Спасибо за отправку Вашего сообщения.<br><br> В ближайшее время Вы обязательно получите ответ. </h3>";
else
return " <h3 class='text-center'>Приносим извинения.<br><br>в связи с техническими неполадками сообщение отправить не удалось</h3>";
Apparently touched, or you or the hoster.
In general, you can go to Freelancing
or Google.
Do you have access to server logs? as mines in the root of your account should be. Take a look or post a piece. If not, then go to the fortuneteller.
+ Are you from Chernivtsi by any chance?)..
Use a mailbox on gmail for example if sending mail locally doesn't work.
swiftmailer.org
Creating a message:
require_once 'lib/swift_required.php';
// Create the Transport
$transport = Swift_SmtpTransport::newInstance('smtp.gmail.com', 465, 'ssl');
->setUsername('your username')
->setPassword('your password')
;
/*
You could alternatively use a different transport such as Sendmail or Mail:
// Sendmail
$transport = Swift_SendmailTransport::newInstance('/usr/sbin/sendmail -bs');
// Mail
$transport = Swift_MailTransport::newInstance();
*/
// Create the Mailer using your created Transport
$mailer = Swift_Mailer::newInstance($transport);
// Create a message
$message = Swift_Message::newInstance('Тема сообщения')
->setFrom(array('[email protected]' => 'John Doe')) //от кого
->setTo(array('[email protected]', '[email protected]' => 'A name'))//кому
->setBody('Here is the message itself')//тело сообщения
;
// Send the message
$result = $mailer->send($message);
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question