Serveis de pagines web

pluja de serveis que ofereix SolucioPC envers les pagines web

disseny de pagines web

creació de pagines web

empresa de pagines web

posicionament de pagines web

posicionament google

pagines web barcelona

pagines web girona

pagines web tarragona

pagines web lleida

disseny web barcelona

empresa de pagines web barcelona

programació web barcelona

SolucioPC forma part del Grup F5, estem a Carrer Calabria 21-23 amb Carrer Manso 15-17 de la ciutat de Barcelona. Tenim una gran experiencia en la creació de pagines web, per tant tenim un gran portafoli web per mostrar, per tant ens considerem una bona referencia de empresa de pagines web a Barcelona.

Si voste te necesitat de crear una pagina web, seria bo, que contactes amb un especialista com nosaltres, i li realitzarem un pressupost web sense cap compromis, i deixis aconsellar per una empresa web especialista en deixar satisfet el client, complint les seves necesitats, i realitzant la seva pagina web complint tots els estandards y els ultims llenguatges de programació web.

SolucioPC, empresa de pagines web Barcelona

Posted in Multimedia | No Hay comentarios »
Escrito por admin

Funció per enviar mails via PHP


/*
Envia mail amb adjunts. Per enviar adjunts s'ha d'omplir l'array $attachments de forma adecuada;
Exemple:
$attachments[0]['name']='Nom per descarregar'
$attachments[0]['file']='ruta/de/larxiu'
$attagments[0]['type']= 'image/jpeg'

O si volem enviar directament desde $_FILES
foreach($_FILES as $key => $value)
{
$attachments[$n][’file’] = $value[’tmp_name’];
$attachments[$n][’name’] = $value[’name’];
$attachments[$n][’content_type’] = $value[’type’];
$n++;
}
després només cal cridar la funció
send_mail(bill@microsoft.com, _BODY_, ‘Hi!’, ‘larry@google.com’, ‘Larry Page’,$attachments);
Nota: El body s’interpreta com HTML
Retorna 1 si s’ha enviat correctament
*/

function send_mail($to, $body, $subject, $fromaddress, $fromname, $attachments=false)
{
$eol=”\r\n”;
$mime_boundary=md5(time());

# Common Headers
$headers .= “From: “.$fromname.”<".$fromaddress.">“.$eol;
$headers .= “Reply-To: “.$fromname.”<".$fromaddress.">“.$eol;
$headers .= “Return-Path: “.$fromname.”<".$fromaddress.">“.$eol;
$headers .= “Message-ID: <".time()."-".$fromaddress.">“.$eol;
$headers .= “X-Mailer: PHP v”.phpversion().$eol;

# Boundry for marking the split & Multitype Headers (Crea Seccions)
$headers .= ‘MIME-Version: 1.0′.$eol;
$headers .= “Content-Type: multipart/mixed; boundary=\”".$mime_boundary.”\”".$eol;

# Open the first part of the mail

$msg = “–”.$mime_boundary.$eol;

$htmlalt_mime_boundary = $mime_boundary.”_htmlalt”; //we must define a different MIME boundary for this section (Sub-Seccions)
# Setup for text OR html -
$msg .= “Content-Type: multipart/alternative; boundary=\”".$htmlalt_mime_boundary.”\”".$eol.$eol;

# Text Version
//$msg .= “–”.$htmlalt_mime_boundary.$eol;
//$msg .= “Content-Type: text/plain; charset=iso-8859-1″.$eol;
//$msg .= “Content-Transfer-Encoding: 8bit”.$eol;
//$msg .= “–”.$htmlalt_mime_boundary.”–”.$eol;
//$msg .= strip_tags(str_replace(”
“, “\n”, substr($body, (strpos($body, ““)+6)))).$eol;

# HTML Version
$msg .= “–”.$htmlalt_mime_boundary.$eol;
$msg .= “Content-Type: text/html; charset=UTF-8″.$eol;
$msg .= “Content-Transfer-Encoding: 7bit”.$eol;
$msg .= “Content-Disposition: inline”.$eol.$eol;
$msg .= $body.$eol.$eol;

$msg .= “–”.$htmlalt_mime_boundary.”–”.$eol.$eol;

if ($attachments !== false)
{
for($i=0; $i < count($attachments); $i++)
{

if (is_file($attachments[$i]["file"]))
{
# File for Attachment
$file_name = substr($attachments[$i]["file"], (strrpos($attachments[$i]["file"], "/")+1));

$handle=fopen($attachments[$i]["file"], 'rb');
$f_contents=fread($handle, filesize($attachments[$i]["file"]));
$f_contents=chunk_split(base64_encode($f_contents)); //Encode The Data For Transition using base64_encode();
$f_type=filetype($attachments[$i]["file"]);
fclose($handle);

# Attachment
$msg .= "--".$mime_boundary.$eol;
if(isset($attachments[$i]["name"]))
{
$name=$attachments[$i]["name"];
}
else
{
$name=$file_name;
}
$msg .= "Content-Type: ".$attachments[$i]["content_type"]."; name=\"".$name."\"".$eol;
$msg .= "Content-Transfer-Encoding: base64".$eol;
$msg .= "Content-Description: ".$name.$eol;
$msg .= "Content-Disposition: attachment; filename=\"".$name."\"".$eol.$eol; // !! This line needs TWO end of lines !! IMPORTANT !!
$msg .= $f_contents.$eol.$eol;
}
}
}

# Finished
$msg .= "--".$mime_boundary."--".$eol; // finish with two eol's for better security. see Injection.

# SEND THE EMAIL
ini_set(sendmail_from,$fromaddress); // the INI lines are to force the From Address to be used !
$mail_sent = mail($to, $subject, $msg, $headers);

ini_restore(sendmail_from);

return $mail_sent;
}
?>

Posted in Programación web | No Hay comentarios »
Escrito por admin