Jump to content
php.lv forumi

Email @ Junk mail


Rich Bitch

Recommended Posts

Man mājas lapā ir skripts, ka pēc reģistrēšanās lietotājam aiziet e-pasta apstiprināšanas kods, kā arī jaunumu izsūtīšaja lietotājiem, ja viņi ir atzīmējuši ka to vēlas, bet problēma ir tāda, ka šie e-pasti, kas atnāk lietotājam automātiski tiem iemesti pie Junk Mail. Vai ir kaut kā iespējams izdarīt, lai e-pastu nemestu iekš Junk Mail?

E-pastu izsūtu ar parasto "mail()" neizmantojot nekādas klases.

Link to comment
Share on other sites

Nu tad izmanto klases.

 

Es izmantoju PHPMailer, baigi ērti, un par visiem headeriem automātiski par padomāts.

 

Met junkmailā tāpēc, ka varbūt serveris ir iekļuvis melnajos sarakstos, vai trūkst elementāru headeru...

 

Vislabāk tomēr sūtīt meilus plain text'ā, nevis html..

Edited by briedis
Link to comment
Share on other sites

... vai trūkst elementāru headeru...

 

Esi tik labs un izmet kopējai apskatei to koda gabalu, kurš ir piesātināts ar visiem elementārajiem headeriem.

Es arī izmantoju PHPmailer mass email sūtīšanā, bet piemēram inbox.com saskata manos sūtījumos spamu...bet ja sūta text email tad ir ok...bet man neder tikai text...

Es izmantoju sekojošo:

require_once('../class.phpmailer.php');
//include("class.smtp.php"); // optional, gets called from within class.phpmailer.php if not already loaded

$mail = new PHPMailer(true); // the true param means it will throw exceptions on errors, which we need to catch

$mail->IsSMTP(); // telling the class to use SMTP

try {
$mail->Host       = "mail.domain.net"; // SMTP server
$mail->SMTPDebug  = 2;                     // enables SMTP debug information (for testing)
$mail->SMTPAuth   = true;                  // enable SMTP authentication
$mail->Host       = "mail.domain.net"; // sets the SMTP server
$mail->Port       = 26;                    // set the SMTP port for the GMAIL server
$mail->Username   = "[email protected]"; // SMTP account username
$mail->Password   = "123456";        // SMTP account password
$mail->AddReplyTo('[email protected]', 'Johan');
$mail->AddAddress('[email protected]', 'Vasja Pupkin');
$mail->SetFrom('[email protected]', 'Bill');
$mail->AddReplyTo('[email protected]', 'Max');
$mail->Subject = 'Hi email reader';
$mail->AltBody = 'To view the message, please use an HTML compatible email viewer!'; // optional - MsgHTML will create an alternate automatically
$mail->MsgHTML(file_get_contents('contents.html'));
       $mail->AddAttachment('images/header.jpg');      // attachment
$mail->Send();
	 echo "Ir ok!" ;

} catch (phpmailerException $e) {
echo $e->errorMessage(); //Pretty error messages from PHPMailer
} catch (Exception $e) {
  echo $e->getMessage(); //Boring error messages from anything else!
}

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...