Jump to content
php.lv forumi

e-pasts riga.lv


osk

Recommended Posts

Vai kāds ir saskāries ar riga.lv pasta serveri?

Es uztaisīju skriptu, kas sūta e-pastu ar pielikumu (html dokuments, kurā ir info no formas). Bet pasta serveris nerāda pielikumu, bet tikai kodētu virkni...

Kāds var palīdzēt?

inbox.lv nekādu problēmu nav...

Edited by osk
Link to comment
Share on other sites

Kods:

$email=$fprivepasts;
$to = "$name <$email>"; 
$from = "Bla bla bla<bla@blabla.lv>"; 
$subject = "pielikums"; 
$fileatttype = "text/html"; 
$fileattname = "pielikums.html";
$headers = 'Cc: bla2@blabla.lv' . "\r\n";
$headers .= "From: $from";

$data='
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Virsraksts</title>
</head>

<body>Teksta blāķis HTML
</body>
</html>
';

       $semi_rand = md5( time() ); 
       $mime_boundary = "==Multipart_Boundary_x{$semi_rand}x"; 

       $headers .= "\nMIME-Version: 1.0\n" . 
                   "Content-Type: multipart/mixed;\n" . 
                   " boundary=\"{$mime_boundary}\"";

       $message = "This is a multi-part message in MIME format.\n\n" . 
               "--{$mime_boundary}\n" . 
               "Content-Type: text/plain; charset=\"utf-8\"\n" . 
               "Content-Transfer-Encoding: 7bit\n\n" . 
               "Teksts e-pasta vēstulē."."\n\n";
               $message . "\n\n";

       $data = chunk_split( base64_encode( $data ) );

       $message .= "--{$mime_boundary}\n" . 
                "Content-Type: {$fileatttype};\n" . 
                " name=\"{$fileattname}\"\n" . 
                "Content-Disposition: attachment;\n" . 
                " filename=\"{$fileattname}\"\n" . 
                "Content-Transfer-Encoding: base64\n\n" . 
                $data . "\n\n" . 
                "--{$mime_boundary}--\n"; 

@mail( $to, $subject, $message, $headers );

Link to comment
Share on other sites

Manuprāt tiem headeriem priekš HTMLa būt jābūt aptuveni šādiem:

Content-Type: text/html; charset=utf-8
Content-Transfer-Encoding: Quoted-printable
Content-Disposition: inline

Vienīgi neatceros, ar ko bija garumzīmjainie burti jākodē, jo garumzīmes tekstam:

Kārlis

tiek pārveidotas par:

K=C4=81rlis

Link to comment
Share on other sites

Izlasīju sekojošo:

gmail:

MIME-Version: 1.0

Content-Type: multipart/mixed;

boundary="==Multipart_Boundary_xfbbc37ac2e0b035289fb8d88973cda76x"

 

riga.lv:

MIME-Version: 1.0

Content-Type: multipart/alternative;

boundary="----_=_NextPart_001_01CABA01.BD41C8BC"

Link to comment
Share on other sites

Es paskatoties Gmailā kaut kādus mailus, kas man pienākuši htmliski redzu aptuveni šādu:

headeri uc lietas
Mime-Version: 1.0
Content-Type: multipart/alternative; boundary=mimepart_XXX

--mimepart_XXX
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: Quoted-printable
Content-Disposition: inline

Plaintext versija


--mimepart_XXX
Content-Type: text/html; charset=utf-8
Content-Transfer-Encoding: Quoted-printable
Content-Disposition: inline

<html><body>HTML versija</body></html>

--mimepart_XXX--

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...