Salve, ho problemi con l'invio di dati tramite il form di contatti, non ricevo nessuna e-mail , premetto che sono agli inizi , il sito e stato creato, con Adobe Muse , quindi ho usato un Widget per il form.
Printable View
Salve, ho problemi con l'invio di dati tramite il form di contatti, non ricevo nessuna e-mail , premetto che sono agli inizi , il sito e stato creato, con Adobe Muse , quindi ho usato un Widget per il form.
Salve... ho pubblicato il sito su Adobe businesscatalyst.com e il form , funziona alla perfezione, Non capisco perché su AlterVista non deve funzionare ! C'è qualcuno che riesce a aiutarmi? per favore Grazie in anticipo
Hai verificato che la mail non finisca nella cartella della posta indesiderata? Hai provato ad inviare verso indirizzi email differenti?
Ho provato con email differenti ho controllato nell'indesiderata ma nnt , Muse crea un file .php per il test e funziona , Non riesco proprio a capire cosa può essere?
Ho provato Gmail e Hotmail.
Nel codice mi dice questo
potrebbe essere questo il problema ?Codice:/*
If you see this text in your browser, PHP is not configured correctly on this hosting provider.
Contact your hosting provider regarding PHP configuration for your site.
PHP file generated by Adobe Muse CC 2014.3.2.295
*/
No, molto probabilmente il messaggio viene filtrato dai sistemi antispam (o talvolta solo ritardato) degli indirizzi di destinazione. Lunedì potremo verificare se le mail vengono effettivamente spedite.
Ok grazie mille
Salve ... scusatemi , si potrebbe verificare se il mio form invia le mail .... Grazie
Se stai inviando mail di tipo HTML ricordati di aggiungere anche l'header MIME-Version.
Con quale mittente stai inviando le mail?
Uso la mail di Altervista che sarebbe Gmail !
Ricapitolando ... Io uso Adobe Muse , dove genera automaticamente il Codice , ho testato l'invio con questo codice generato sempre da Muse e funziona !, Io di codice php ne so poco, sono alle prime armi sto imparando Più la parte grafica !
Codice:<?php
/*
If you see this text in your browser, PHP is not configured correctly on this hosting provider.
Contact your hosting provider regarding PHP configuration for your site.
PHP file generated by Adobe Muse CC 2014.3.2.295
*/
require_once('form_throttle.php');
if ($_SERVER['REQUEST_METHOD'] == 'GET')
{
$supportResponse = checkSupport();
if (!empty($_GET['mode']) and $_GET['mode'] == 'verify')
{
echo $supportResponse;
exit;
}
echo('<!DOCTYPE html><html><head><title>Muse PHP Diagnostics</title>');
echo('<style type="text/css">body { font: 14pt Myriad Pro, Arial, Helvetica;}ul { list-style-type: none; }');
echo(' h1 { background-color: #CCCCCC; padding: 2px;} label {display: inline-block; width: 100px; vertical-align: top;}');
echo('.good:before { color: green; content:\'\2713\0020\';} .bad:before {color: red; content: \'X\0020\';}');
echo('</style></head><body>');
echo('<h1>Diagnostics</h1><ul>');
if (strrpos($supportResponse,'PHP:0;') === false)
{
echo('<li class="bad">PHP version too low');
}
else
{
echo('<li class="good">PHP version ok');
}
if (strrpos($supportResponse,'Mail:0;') === false)
{
echo('<li class="bad">mail configured incorrectly');
}
else
{
echo('<li class="good">mail configuration ok');
}
if (strrpos($supportResponse,'SQL:0;') === false)
{
echo('<li class="bad">SQL configuration problem ');
}
else
{
echo('<li class="good">SQL ok ');
}
echo('</ul><br/><br/>');
echo('</body></html>');
}
$phpError = '';
function phpErrorHandler($errno, $errstr, $errfile, $errline)
{
global $phpError;
if (!(error_reporting() & $errno))
{
return;
}
$phpError .= $errstr;
return true;
}
function checkSupport()
{
global $phpError;
set_error_handler("phpErrorHandler");
$throttleSupport = formthrottle_check();
$response ='SQL:' . $throttleSupport . ';';
$version = explode('.', PHP_VERSION);
if ($version[0] < 4 || ($version[0] == 4 && $version[1] < 1))
{
$response .='PHP:1;';
return $response;
}
else
{
$response .='PHP:0;';
}
if (strncasecmp(php_uname('s'), 'win', 3) == 0)
{
$mailserver = ini_get('SMTP');
}
else
{
$mailserver = ini_get('sendmail_path');
}
if (strlen($mailserver) == 0)
{
$response .='Mail:1;';
}
else
{
if (!function_exists("mail"))
{
$response .='Mail:2;';
}
else
{
$sent = mail("recipient@example.com", "Hi", "test message", "From: sender@example.com");
if($sent)
{
$response .='Mail:0;';
}
else
{
$response .='Mail:3;';
}
}
}
if($phpError != '')
{
$response .='PHPError:' . $phpError;
}
return $response;
}
?>
L'header da aggiungere è questo:
Ma questa parte come fa a funzionare? Come imposti mittente e destinatario?Codice:$sent = mail("recipient@example.com", "Hi", "test message", "From: sender@example.com\r\nMIME-Version: 1.0\r\n");
Quello è solo un Php per testare ,
Credo si questo ad impostare
e questo credo sia la parte del headers che dicevi teCodice:<?php
/*
If you see this text in your browser, PHP is not configured correctly on this hosting provider.
Contact your hosting provider regarding PHP configuration for your site.
PHP file generated by Adobe Muse CC 2014.3.2.295
*/
require_once('form_throttle.php');
function process_form($form) {
if ($_SERVER['REQUEST_METHOD'] != 'POST')
die(get_form_error_response($form['resources']['unknown_method']));
if (formthrottle_too_many_submissions($_SERVER['REMOTE_ADDR']))
die(get_form_error_response($form['resources']['too_many_submissions']));
// will die() if there are any errors
check_required_fields($form);
// will die() if there is a send email problem
email_form_submission($form);
}
function get_form_error_response($error) {
return get_form_response(false, array('error' => $error));
}
function get_form_response($success, $data) {
if (!is_array($data))
die('data must be array');
$status = array();
$status[$success ? 'FormResponse' : 'MusePHPFormResponse'] = array_merge(array('success' => $success), $data);
return json_serialize($status);
}
function check_required_fields($form) {
$errors = array();
foreach ($form['fields'] as $field => $properties) {
if (!$properties['required'])
continue;
if (!array_key_exists($field, $_REQUEST) || empty($_REQUEST[$field]))
array_push($errors, array('field' => $field, 'message' => $properties['errors']['required']));
else if (!check_field_value_format($form, $field, $properties))
array_push($errors, array('field' => $field, 'message' => $properties['errors']['format']));
}
if (!empty($errors))
die(get_form_error_response(array('fields' => $errors)));
}
function check_field_value_format($form, $field, $properties) {
$value = get_form_field_value($field, $properties, $form['resources']);
switch($properties['type']) {
case 'checkbox':
case 'string':
case 'captcha':
// no format to validate for those fields
return true;
case 'recaptcha':
if (!array_key_exists('recaptcha', $form) || !array_key_exists('private_key', $form['recaptcha']) || empty($form['recaptcha']['private_key']))
die(get_form_error_response($form['resources']['invalid_reCAPTCHA_private_key']));
$resp = recaptcha_check_answer($form['recaptcha']['private_key'], $_SERVER["REMOTE_ADDR"], $_POST["recaptcha_challenge_field"], $_POST["recaptcha_response_field"]);
return $resp->is_valid;
case 'email':
return 1 == preg_match('/^[a-z0-9!#$%&\'*+\/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&\'*+\/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i', $value);
default:
die(get_form_error_response(sprintf($form['resources']['invalid_field_type'], $properties['type'])));
}
}
function email_form_submission($form) {
if(!defined('PHP_EOL'))
define('PHP_EOL', '\r\n');
$form_email = ((array_key_exists('Email', $_REQUEST) && !empty($_REQUEST['Email'])) ? cleanup_email($_REQUEST['Email']) : '');
$to = $form['email']['to'];
$subject = $form['subject'];
$message = get_email_body($subject, $form['heading'], $form['fields'], $form['resources']);
$headers = get_email_headers($to, $form_email);
$sent = @mail($to, $subject, $message, $headers);
if(!$sent)
die(get_form_error_response($form['resources']['failed_to_send_email']));
$success_data = array(
'redirect' => $form['success_redirect']
);
echo get_form_response(true, $success_data);
}
function get_email_headers($to_email, $form_email) {
$headers = 'From: ' . $to_email . PHP_EOL;
$headers .= 'Reply-To: ' . $form_email . PHP_EOL;
$headers .= 'X-Mailer: Adobe Muse CC 2014.3.2.295 with PHP' . PHP_EOL;
$headers .= 'Content-type: text/html; charset=utf-8' . PHP_EOL;
return $headers;
}
function get_email_body($subject, $heading, $fields, $resources) {
$message = '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">';
$message .= '<html xmlns="http://www.w3.org/1999/xhtml">';
$message .= '<head><meta http-equiv="Content-Type" content="text/html;charset=UTF-8"/><title>' . encode_for_form($subject) . '</title></head>';
$message .= '<body style="background-color: #ffffff; color: #000000; font-style: normal; font-variant: normal; font-weight: normal; font-size: 12px; line-height: 18px; font-family: helvetica, arial, verdana, sans-serif;">';
$message .= '<h2 style="background-color: #eeeeee;">' . $heading . '</h2>';
$message .= '<table cellspacing="0" cellpadding="0" width="100%" style="background-color: #ffffff;">';
$sorted_fields = array();
foreach ($fields as $field => $properties) {
// Skip reCAPTCHA from email submission
if ('recaptcha' == $properties['type'])
continue;
array_push($sorted_fields, array('field' => $field, 'properties' => $properties));
}
// sort fields
usort($sorted_fields, 'field_comparer');
foreach ($sorted_fields as $field_wrapper)
$message .= '<tr><td valign="top" style="background-color: #ffffff;"><b>' . encode_for_form($field_wrapper['properties']['label']) . ':</b></td><td>' . get_form_field_value($field_wrapper['field'], $field_wrapper['properties'], $resources) . '</td></tr>';
$message .= '</table>';
$message .= '<br/><br/>';
$message .= '<div style="background-color: #eeeeee; font-size: 10px; line-height: 11px;">' . sprintf($resources['submitted_from'], encode_for_form($_SERVER['SERVER_NAME'])) . '</div>';
$message .= '<div style="background-color: #eeeeee; font-size: 10px; line-height: 11px;">' . sprintf($resources['submitted_by'], encode_for_form($_SERVER['REMOTE_ADDR'])) . '</div>';
$message .= '</body></html>';
return cleanup_message($message);
}
function field_comparer($field1, $field2) {
if ($field1['properties']['order'] == $field2['properties']['order'])
return 0;
return (($field1['properties']['order'] < $field2['properties']['order']) ? -1 : 1);
}
function is_assoc_array($arr) {
if (!is_array($arr))
return false;
$keys = array_keys($arr);
foreach (array_keys($arr) as $key)
if (is_string($key)) return true;
return false;
}
function json_serialize($data) {
if (is_assoc_array($data)) {
$json = array();
foreach ($data as $key => $value)
array_push($json, '"' . $key . '": ' . json_serialize($value));
return '{' . implode(', ', $json) . '}';
}
if (is_array($data)) {
$json = array();
foreach ($data as $value)
array_push($json, json_serialize($value));
return '[' . implode(', ', $json) . ']';
}
if (is_int($data) || is_float($data))
return $data;
if (is_bool($data))
return $data ? 'true' : 'false';
return '"' . encode_for_json($data) . '"';
}
function encode_for_json($value) {
return preg_replace(array('/([\'"\\t\\\\])/i', '/\\r/i', '/\\n/i'), array('\\\\$1', '\\r', '\\n'), $value);
}
function encode_for_form($text) {
return htmlentities($text, ENT_COMPAT, 'UTF-8');
}
function get_form_field_value($field, $properties, $resources) {
$value = $_REQUEST[$field];
switch($properties['type']) {
case 'checkbox':
return (($value == '1' || $value == 'true') ? $resources['checkbox_checked'] : $resources['checkbox_unchecked']);
case 'string':
case 'captcha':
case 'recaptcha':
case 'email':
return encode_for_form($value);
default:
die(get_form_error_response(sprintf($resources['invalid_field_type'], $properties['type'])));
}
}
function cleanup_email($email) {
$email = encode_for_form($email);
$email = preg_replace('=((<CR>|<LF>|0x0A/%0A|0x0D/%0D|\\n|\\r)\S).*=i', null, $email);
return $email;
}
function cleanup_message($message) {
$message = wordwrap($message, 70, "\r\n");
return $message;
}
?>
Con questo ti ho postato tutto il codice , scusami , ma così siamo sicuri !Codice:function get_email_headers($to_email, $form_email) {
$headers = 'From: ' . $to_email . PHP_EOL;
$headers .= 'Reply-To: ' . $form_email . PHP_EOL;
$headers .= 'X-Mailer: Adobe Muse CC 2014.3.2.295 with PHP' . PHP_EOL;
$headers .= 'Content-type: text/html; charset=utf-8' . PHP_EOL;
return $headers;
}
Codice:require_once('form_process.php');
$form = array(
'subject' => 'Invio di contatti',
'heading' => 'Nuovo invio del modulo',
'success_redirect' => '',
'resources' => array(
'checkbox_checked' => 'Selezionato',
'checkbox_unchecked' => 'Non selezionato',
'submitted_from' => 'Modulo inviato dal sito Web: %s',
'submitted_by' => 'Indirizzo IP del visitatore: %s',
'too_many_submissions' => 'Troppi invii recenti da questo IP',
'failed_to_send_email' => 'Invio e-mail non riuscito',
'invalid_reCAPTCHA_private_key' => 'Chiave privata reCAPTCHA non valida.',
'invalid_field_type' => 'Tipo di campo \"%s\" sconosciuto.',
'unknown_method' => 'Metodo di richiesta server sconosciuto'
),
'email' => array(
'from' => 'amministratoresito.libero@gmail.com',
'to' => 'amministratoresito.libero@gmail.com'
),
'fields' => array(
'custom_U1289' => array(
'order' => 1,
'type' => 'string',
'label' => 'Nome',
'required' => true,
'errors' => array(
'required' => 'Il campo \'Nome\' è obbligatorio.'
)
),
'Email' => array(
'order' => 2,
'type' => 'email',
'label' => 'E-mail',
'required' => true,
'errors' => array(
'required' => 'Il campo \'E-mail\' è obbligatorio.',
'format' => 'L\'e-mail del campo \"E-mail\" non è valido.'
)
),
'custom_U1311' => array(
'order' => 3,
'type' => 'string',
'label' => 'Messaggio',
'required' => true,
'errors' => array(
'required' => 'Il campo \'Messaggio\' è obbligatorio.'
)
)
)
);
process_form($form);
?>
Buongiorno. anche io ho un problema simile da alcuni giorni (diciamo 7-8 gg). Anche io ho fatto il sito con muse e mi ha sempre spedito le mail normalmente.
Ora non mi arrivano più le mail di chi compila il form. Ho provato a cambiare mail,(gmail, tiscali, iCloud) ma niente il sito non invia più le mail. ma io non ho cambiato assolutamente niente. Perché ora non le invia più? mi potete aiutare?
Hai qualche comunicazione nel pannello riguardo alla disabilitazione del servizio mail?
Ciao!
Ti ho risposto qui.
Ciao!
Salve, riguardo ad invio mail anche io non riesco a capire quale sia il problema del mio sito. Se invio una mail dal form contatti ,(contact form 7),tramite PC tutto funziona perfettamente, MA se lo invio da cellulare o mobile non va, dopo aver cliccato su "Invia" mi rimane sempre in funzione in loop l'iconcina delle freccette che girano in cerchio all'infinito senza in realtà inviare nulla. Insomma, via PC contact form 7 funziona bene, via mobile NO. Qualcuno puo' aiutarmi?
Sembra un problema del plugin, ti consiglierei di segnalarlo allo sviluppatore.
L'unica cosa che potresti provare è di disattivare la modalità "mobile" (se è attiva).
Ciao!
AIUTO, ho contattato il supporto in wordpress support per un problema di invio mail tramite mobile non funzionante ma il loro consiglio di modifica " function.php " del tema radiate mi ha bloccato il sito, non riesco più ad entrare, l'errore che compare è questo:
Parse error: syntax error, unexpected '*', expecting end of file in /membri/dtutto1po/wp-content/themes/radiate/functions.php on line 9
Si è verificato un errore critico sul tuo sito web. Controlla la casella di posta dell'amministratore del sito per istruzioni.