Jump to content
php.lv forumi

Epastam pievienot laukus


laucinieks

Recommended Posts

Man tas neder :(.

Šeit ir cik tālu esmu ticis - http://paste.php.lv/...d41bfb?lang=php

Tātad, tagad vajag to attachment iekļaut epastā, skatījos google, bet neviens no variantiem man nesanāk, varbūt variet palīdzēt?

L.

 

Tu nu gan esi slinks!

 

$mail = new PHPMailer(true);
$mail->AddAddress("[email protected]");
$mail->SetFrom("[email protected]", "Sūtītāja vārds");
$mail->AddReplyTo("[email protected]", "Sūtītāja vārds");
$mail->Subject = "Temats";
$mail->Body = "Body teksts";

//Pievienojam PDF'u
$mail->AddAttachment("cels/uz/failu/fails.pdf", "fails.pdf");

//Mēģinam nosūtīt
try{
   $mail->Send();
   echo "Veiksmīgi nosūtīts";
} catch(Exception $e){
   echo "Kļūda sūtot!";
   print_r($e);
}

 

 

EDIT: Es sapratu, kāpēc citiem gļučī koda ievietošana. Nevajag izmantot to koda ievadīšanas pop-upu, bet gan iekopēt kodu pašā editorā un tad iezīmēt un spiest uz code pogas (vai ielikt [ CODE] tagos)

Edited by briedis
Link to comment
Share on other sites

Ne tur tā problēma, briedi. Es, kā normāls cilvēks, izmantoju tabus. Tu speisus.

Tās nu gan ir muļķības, es speisus nekad neesmu izmantojis (derdzas). Šitais editors viņus pārveido, acīmredzot.

Bet nu pamēģini iekopēt kodu.

 

1. Izmantojot to popupu (pazudīs atkāpes)

2. Iekopējot pa taisno editora kodu un tad wrappojot code tagos. (viss būs normāli)

Edited by briedis
Link to comment
Share on other sites

Nu nē, Tu kļūdies! Man ir kods ar tabiem. Es Viņu tepat iepaistoju, ar to pogu salieku apkār CODE tagus. Un lūk...

 

 

if (!empty($_POST) && !empty($_POST['input'])) {

$output = $_POST['input'];

$lc_pairs = array(
'a' => '',
'e' => '',
'i' => '',
'o' => '',
'u' => '',
);

$uc_pairs = array(
'A' => '',
'E' => '',
'I' => '',
'O' => '',
'U' => '',
);

$output = strtr($output, $lc_pairs);
$output = strtr($output, $uc_pairs);

}

Link to comment
Share on other sites

Nebūs, jau lieku augšā phpMailer, domāju, ka PHPMailer ir pavisam cita lieta, mazliet biju sajaucis.

Par tiem code.

Kods, kuru lieku popup logā -

public function is_logged_in()
{
 if ($_SESSION['logged_in'] != 1) // Check if user is logged in.
 {
header('location: index.php');
 }
}

 

Iezīmējot un uzspiežot code -

 

public function is_logged_in()
{
 if ($_SESSION['logged_in'] != 1) // Check if user is logged in.
 {
   header('location: index.php');
 }
}

 

Un uzrakstot ar roku apkārt code -

 

public function is_logged_in()
{
 if ($_SESSION['logged_in'] != 1) // Check if user is logged in.
 {
   header('location: index.php');
 }
}

 

Visiem ir failā atstarpes.

EDIT: Man visos veidos strādā atkāpes...

Edited by laucinieks
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...