WebSite X5Help Center

 
Roberto B.
Roberto B.
User

Modulo invio mail non funziona  it

Auteur : Roberto B.
Visité 1495, Followers 1, Partagé 0  
Mots-clés :: mail,modulo,php

Ho bisogno di aiuto per quanto riguarda l'invio mail dal modulo sulla pagina del sito.

Compilando tutto correttamente non mi arrivano le mail.

Le estensioni php a detta del provider sono correttamente attive.

Ecco la pagina:http://www.liutart.it/contatti.html

Posté le
13 RéPONSES
Roberto B.
Roberto B.
User
Auteur

Nello SPAM non c'è niente.

Il test al quale fai riferimento non ho idea di cosa sia e nemmeno "lo STAMP del pannello di verifica".

Il topic precedente http://answers.websitex5.com/post/85055 è in effetti quello al quale faccio riferimento. In precedenza non usciva il codice captcha e successivamente ho risolto il problema, come si legge dal topic. Però non avevo effettivamente mai testato il fatto che arrivassero o meno le mail, dando per scontato che tutto funzionasse correttamente, ma ora mi sono accorto di questo perchè era troppo strano che nessuno mi mandasse una mail direttamente dal sito, ed ho fatto delle prove appurando che non funziona.

Lire plus
Posté le de Roberto B.
 ‪ KolAsim ‪ ‪
 ‪ KolAsim ‪ ‪
Moderator
Meilleur utilisateur du mois RU
Roberto B.
... ... Il test al quale fai riferimento non ho idea di cosa sia e nemmeno "lo STAMP del pannello di verifica". ... ... ...

... anche se non ne hai idea, riporta lo stesso i risultati dal link che ti ho indicato...

... se non ti ricordi user/pass, ...vai a vedere al >> Passo_4 - Impostazioni Avanzate >

Gestione Accessi | (Admin) | ▪Modifica

...............

...?... cosa è STAMP, (PRTSC), (PrintScreen), (screenshot), ...?...

... STAMP, funzione attiva dagli albori di Windows; ...è il tasto funzione che effettua la cattura (o foto) in formato immagine negli appunti d Windows di ciò che è compreso nello schermo visibile; ... la stessa funzione esiste in Windows/Start/Programmi/Accessori/Strumento di Cattura ...da usare in alternativa a STAMP...

>>> azionare STAMP >> aprire >> MsPaint, >> fare Ctrl+V (incolla), salvare in JPG ed allegare qui...

...

.



Lire plus
Posté le de  ‪ KolAsim ‪ ‪
Roberto B.
Roberto B.
User
Auteur

Ok, scusa non navevo capito di dover fare un immagine dello schermo.

Ti allego il risultato.

Lire plus
Posté le de Roberto B.
 ‪ KolAsim ‪ ‪
 ‪ KolAsim ‪ ‪
Moderator
Meilleur utilisateur du mois RU

... la banda ROSSA/FAIL indica che non potrai usare guestbook e blog, e se di interesse futuro, andrebbe regolarizzato...

... adesso, per il quesito formulato, devi effettuare i vari TEST proposti in Verifica le impostazioni di invio e-mail ...verificando quale è la script che risponde ai risultati...

... in caso di esito negativo, puoi anche fare una verifica in più, il 3° TEST proposto qui:   http://www.zspace.it/kolasim/mio_php/test_PHP.txt

.

ciao

Lire plus
Posté le de  ‪ KolAsim ‪ ‪
Roberto B.
Roberto B.
User
Auteur

Il risultato del test è il seguente, ma non sono in grado di capirci qualcosa:

<?php
//Incomedia WebSite X5 EMail Class. All rights reserved.

class imEMail {
var $from;
var $to;
var $subject;
var $charset;
var $text;
var $html;
var $type;
var $newline = "\r\n";

var $attachments;

function imEMail($from,$to,$subject,$charset) {
$this->from = $from;
$this->to = $to;
$this->charset = $charset;
$this->subject = strlen($subject) ? "=?" . strtoupper($this->charset) . "?B?". base64_encode($subject) . "?=" : "";
}

/**
* Set the type of email standard (HTML, HTML-X or Text-only)
* @param [type] $type [description]
*/
function setStandardType($type = "html") {
$this->type = $type;
$this->newline = (strtolower($type) == "html-x" ? "\n" : "\r\n");
}

function setFrom($from) {
$this->from = $from;
}

function setTo($to) {
$this->to = $to;
}

function setSubject($subject) {
if (strlen($subject))
$this->subject = "=?" . strtoupper($this->charset) . "?B?". base64_encode($subject) . "?=";
else
$this->subject = "";
}

function setCharset($charset) {
$this->charset = $charset;
}

function setText($text) {
$this->text = $text;
}

function setHTML($html) {
$this->html = $html;
}

function attachFile($name,$content,$mime_type) {
if (strlen($name) === 0)
return false;
$attachment['name'] = "=?" . strtoupper($this->charset) . "?B?". base64_encode($name) . "?=";
$attachment['content'] = base64_encode($content);
$attachment['mime_type'] = $mime_type;
$this->attachments[] = $attachment;
}

function send() {
$headers = "";
$msg = "";

if($this->from == "" || $this->to == "" || ($this->text == "" && $this->html == ""))
return false;

if ($this->type != "text") {

/*
|-------------------------------
| HTML/HTML-X email
|-------------------------------
*/

$boundary_file = md5(time() . "_attachment");
$boundary_alt = md5(time() . "_alternative");

$headers .= "From: " . $this->from . $this->newline;
$headers .= "Message-ID: <" . time() . rand(0,9) . rand(0,9) . "@websitex5.users>" . $this->newline;
$headers .= "X-Mailer: WebSiteX5 Mailer" . $this->newline;

$headers .= "MIME-Version: 1.0" . $this->newline;

if(is_array($this->attachments)) {
$headers .= "Content-Type: multipart/mixed; boundary=\"" . $boundary_file . "\"" . $this->newline . $this->newline;
$headers .= "--" . $boundary_file . $this->newline;
}

if($this->html == "") {
$headers .= "Content-Type: text/plain; charset=" . strtoupper($this->charset) . $this->newline;<br /> if (strtolower($this->charset) != "utf-8")
$headers .= "Content-Transfer-Encoding: 7bit" . $this->newline;
else
$headers .= "Content-Transfer-Encoding: 8bit" . $this->newline;
$msg .= $this->text . $this->newline . $this->newline;
}
else if($this->text == "") {
$headers .= "Content-Type: text/html; charset=" . strtoupper($this->charset) . $this->newline;<br /> if (strtolower($this->charset) != "utf-8")
$headers .= "Content-Transfer-Encoding: 7bit" . $this->newline;
else
$headers .= "Content-Transfer-Encoding: 8bit" . $this->newline;
$msg .= $this->html . $this->newline . $this->newline;
}
else {
$headers .= "Content-Type: multipart/alternative; boundary=\"" . $boundary_alt . "\"" . $this->newline;

$msg .= "--" .$boundary_alt . $this->newline;
$msg .= "Content-Type: text/plain; charset=" . strtoupper($this->charset) . $this->newline;<br /> if (strtolower($this->charset) != "utf-8")
$msg .= "Content-Transfer-Encoding: 7bit" . $this->newline;
else
$msg .= "Content-Transfer-Encoding: 8bit" . $this->newline;
$msg .= $this->newline;
$msg .= $this->text . $this->newline . $this->newline;

$msg .= "--" . $boundary_alt . $this->newline;
$msg .= "Content-Type: text/html; charset=" . strtoupper($this->charset) . $this->newline;<br /> if (strtolower($this->charset) != "utf-8")
$msg .= "Content-Transfer-Encoding: 7bit" . $this->newline;
else
$msg .= "Content-Transfer-Encoding: 8bit" . $this->newline;
$msg .= $this->newline;
$msg .= $this->html . $this->newline . $this->newline;

$msg .= "--" . $boundary_alt . "--" . $this->newline . $this->newline;
}

if(is_array($this->attachments)) {
foreach($this->attachments as $attachment) {
$msg .= "--" . $boundary_file . $this->newline;
$msg .= "Content-Type: " . $attachment["mime_type"] . "; name=\"" . $attachment["name"] . "\"" . $this->newline;
$msg .= "Content-Transfer-Encoding: base64" . $this->newline;
$msg .= "Content-Disposition: attachment; filename=\"" . $attachment["name"] . "\"" . $this->newline . $this->newline;
$msg .= chunk_split($attachment["content"]) . $this->newline . $this->newline;
}
$msg .= "--" . $boundary_file . "--" . $this->newline . $this->newline;
}

if (function_exists('ini_set'))
@ini_set("sendmail_from", $this->from);

// First attempt: -f flag, no more headers
if(@mail($this->to, $this->subject, $msg, $headers, "-f" . $this->from))
return true;
// Second attempt: no -f flag, no more headers
if (@mail($this->to, $this->subject, $msg, $headers))
return true;
// Third attempt: no -f flag, one more To header
$headers = "To: " . $this->to . $this->newline . $headers;
return @mail($this->to, $this->subject, $msg, $headers);
} else {

/*
|-------------------------------
| Text-only email
|-------------------------------
*/

$headers .= "From: " . $this->from . $this->newline;
$headers .= "Content-Type: text/plain;charset=" . $this->charset . $this->newline;
$msg .= $this->text . $this->newline . $this->newline;

$r = @mail($this->to, $this->subject, $msg, $headers);
return $r;
}
}
}

// End of file imemail.inc.php

Lire plus
Posté le de Roberto B.
 ‪ KolAsim ‪ ‪
 ‪ KolAsim ‪ ‪
Moderator
Meilleur utilisateur du mois RU
Roberto B.
Il risultato del test è il seguente, ma non sono in grado di capirci qualcosa: ... ... ... ... ... ... ...

... hai verificato di aver ricevuto le e-mail...?... ...controllando anche nella casella SPAM...?...

 ‪ KolAsim ‪ ‪
... ... ... ... ... ... ... ... in caso di esito negativo, puoi anche fare una verifica in più, il 3° TEST proposto qui:   http://www.zspace.it/kolasim/mio_php/test_PHP.txt ... ...

... hai fatto questa verifica...?...

.

Lire plus
Posté le de  ‪ KolAsim ‪ ‪
Roberto B.
Roberto B.
User
Auteur

Ho verificato che non ci sia niente nella SPAM, ed ho provato anche ad usare un altro indirizzo mail controllando anche in esso se per caso fosse andata nella SPAM ma niente da fare.

Ho fatto tutti i test proposti all'indirizzo sopra e sembra tutto funzionare bene, anche la mail inviata, come dal punto 3, è arrivata correttamente.

Lire plus
Posté le de Roberto B.
 ‪ KolAsim ‪ ‪
 ‪ KolAsim ‪ ‪
Moderator
Meilleur utilisateur du mois RU

... ma, allora secondo me dovresti essere in ordine...

... prova a vedere se sul server hai a disposizioni versioni PHP diverse dalla 5.2.17

.

Lire plus
Posté le de  ‪ KolAsim ‪ ‪
Roberto B.
Roberto B.
User
Auteur

Non saprei proprio come fare

Lire plus
Posté le de Roberto B.
 ‪ KolAsim ‪ ‪
 ‪ KolAsim ‪ ‪
Moderator
Meilleur utilisateur du mois RU

... dovresti vedere nel pannello admin che ti ha messo a disposizione il server; ...eventualmente contattali, e chiedi spiegazione sui permessi MAIL...

... per curiosità , quel codice che hai riportato prima, da dove lo hai estratto...?...

.

ciao

Lire plus
Posté le de  ‪ KolAsim ‪ ‪
Roberto B.
Roberto B.
User
Auteur

Quasi risolto. Ho sentito il gestore del dominio e dello spazio web sul quale ho il sito e perchè il modulo mail funzioni devo usare come mittente un indirizo interno. Ho provato ed effettivamente funziona.

Ma ora il problema è come usare questo indirizzo come mittente ed uno diverso come destinatario. Nel modulo di invio mail non riesco a far si che siano diversi perchè se metto la spunta sulla casella "E-mail mittente" mi usa l'indirizzo di chi invia la mail, mentre se non metto questa spunta mi usa l'indirizzo del destinatario (che per mè dovrebbe essere diverso dal mittente)

Lire plus
Posté le de Roberto B.
 ‪ KolAsim ‪ ‪
 ‪ KolAsim ‪ ‪
Moderator
Meilleur utilisateur du mois RU

... devi renderti conto che il mittente ed il destinatario sono la stessa persona, e quindi devi usare l'account mail del tuo spazio web; ...sei tu che spedisci e che ricevi quello che ti sei inviato a te stesso; ...infatti non c'è sicurezza dei dati se non dopo un doppio riscontro...

... digitando una diversa E-mail mittente è possibile inviare le e-mail di conferma da un indirizzo diverso da quello su cui si ricevono le e-mail provenienti dal Modulo, ma deve essere sempre una e-mail o ALIAS di quella precedentemente usata (se non la stessa), e quindi sempre dello stesso spazio web...

... non posso verificare personalmente, perchè sono due anni e mezzo che non uso il programma, ma la logica dovrebbe essere quella detta; ...resta a te provare e verificare, questione di un attimo...

.

ciao

Lire plus
Posté le de  ‪ KolAsim ‪ ‪