10 Email Etc

67 %
33 %
Information about 10 Email Etc
Technology

Published on June 27, 2009

Author: geshan

Source: slideshare.net

Description

Day 10 Email sending with php

PHP Day 10 Geshan Manandhar Developer, Young Innovations Private Limited www.geshanmanandhar.com http://www.php.net http://www.mysql.com

Email with PHP <?php $to = 'someone@somemail.com'; $subject = 'Test email'; $message = &quot;Hello World! This is my first mail.&quot;; //define the headers we want passed. Note that they are separated with $headers = &quot;From: webmaster@example.com Reply-To: webmaster@example.com&quot;; //send the email $mail_sent = mail( $to, $subject, $message, $headers ); if($mail_sent){ print &quot;Mail sent&quot;; } else { print &quot;Mail failed.&quot;; } ?>

<?php

$to = 'someone@somemail.com';

$subject = 'Test email';

$message = &quot;Hello World! This is my first mail.&quot;;

//define the headers we want passed. Note that they are separated with

$headers = &quot;From: webmaster@example.com Reply-To: webmaster@example.com&quot;;

//send the email

$mail_sent = mail( $to, $subject, $message, $headers );

if($mail_sent){

print &quot;Mail sent&quot;;

}

else {

print &quot;Mail failed.&quot;;

}

?>

Use of Emails Emails are used as an alert system in database focused application. It is sent to notify application user about various activities. Applications like e-card system rely heavily on email. Server configuration, no. or emails allowed etc are also vital in applications that use e-mail.

Emails are used as an alert system in database focused application.

It is sent to notify application user about various activities.

Applications like e-card system rely heavily on email.

Server configuration, no. or emails allowed etc are also vital in applications that use e-mail.

Back to basics Simple program to find a number is odd or even. <?php $number = 4; if($number%2){ $odd = 1; } else { $odd = 0; } //contd…

Simple program to find a number is odd or even.

<?php

$number = 4;

if($number%2){

$odd = 1;

}

else {

$odd = 0;

}

//contd…

Back to basics – C style printf if($odd){ printf (&quot;%d is odd.&quot;, $number); } else { printf (&quot;%d is even.&quot;, $number); } ?>

if($odd){

printf (&quot;%d is odd.&quot;, $number);

}

else {

printf (&quot;%d is even.&quot;, $number);

}

?>

Back to the basics - Ternary Ternary operator <?php $number = 4; $odd = ($number%2) ? 1 : 0; //ternary operator // above single line is equivalent to 6 lines of code of previous program if($odd){ printf (&quot;%d is odd.&quot;, $number); } else { printf (&quot;%d is even.&quot;, $number); } ?>

Ternary operator

<?php

$number = 4;

$odd = ($number%2) ? 1 : 0; //ternary operator

// above single line is equivalent to 6 lines of code of previous program

if($odd){

printf (&quot;%d is odd.&quot;, $number);

}

else {

printf (&quot;%d is even.&quot;, $number);

}

?>

Better programming mantras Use Ternary Operator to save time and LOC- Lines of code. Utilize array and array related functions to the maximum. Implement DRY in coding. Instead of creating multiple functions just add a parameter to existing function to do the job. Use debugging techniques Use functions like print, echo, print_r, var_dump at relevant breakpoints to check the value of the variable.

Use Ternary Operator to save time and LOC- Lines of code.

Utilize array and array related functions to the maximum.

Implement DRY in coding.

Instead of creating multiple functions just add a parameter to existing function to do the job.

Use debugging techniques

Use functions like print, echo, print_r, var_dump at relevant breakpoints to check the value of the variable.

If you have no web template If you layout looks too dull and you can’t design or don’t want to design. Then try out these websites to get free web templates: http://www.opendesigns.org/ http://www.freecsstemplates.org/ http://www.freewebsitetemplates.com/ More at http://delicious.com/geshan/WebTemplates

If you layout looks too dull and you can’t design or don’t want to design.

Then try out these websites to get free web templates:

http://www.opendesigns.org/

http://www.freecsstemplates.org/

http://www.freewebsitetemplates.com/

More at http://delicious.com/geshan/WebTemplates

Simply theme your code Download the template you want. See the <div> structure. Change the static content to the dynamic (PHP) content you want to replace with. Check your output. Hit and trail works if you are not good at designing.

Download the template you want.

See the <div> structure.

Change the static content to the dynamic (PHP) content you want to replace with.

Check your output.

Hit and trail works if you are not good at designing.

A themed users table

Questions

To do Inject your code to a layout from above mentioned website. Make your login system fully functional. Review you code – implement the mantras. Assign message to a variable $message as per login information supplied by user, using the ternary operator. Upload your files to your newly created sub-domain at 000webhost, test them.

Inject your code to a layout from above mentioned website.

Make your login system fully functional.

Review you code – implement the mantras.

Assign message to a variable $message as per login information supplied by user, using the ternary operator.

Upload your files to your newly created sub-domain at 000webhost, test them.

Add a comment

Related presentations

Presentación que realice en el Evento Nacional de Gobierno Abierto, realizado los ...

In this presentation we will describe our experience developing with a highly dyna...

Presentation to the LITA Forum 7th November 2014 Albuquerque, NM

Un recorrido por los cambios que nos generará el wearabletech en el futuro

Um paralelo entre as novidades & mercado em Wearable Computing e Tecnologias Assis...

Microsoft finally joins the smartwatch and fitness tracker game by introducing the...

Related pages

Startseite von Mail Boxes Etc.

Herzlich Willkommen auf der offiziellen Internetseite von Mail Boxes Etc.. Hier finden Sie alles rund um Versand, Verpackung, Grafik und Druck.
Read more

ETC Email Login. Access your email account online from any ...

ETC Email Login - Access your email account 24/7. Check out our help guide or call tech support anytime at 800-717-3710 for assistance.
Read more

Mail Boxes Etc. Dortmund, Bornstraße 10

Öffnungszeiten, Adressen und Kontakte für Mail Boxes Etc. Dortmund - Mbn Packaging & Printing Ohg Bornstraße 10, 44135 Dortmund schnell und einfach finden.
Read more

Emailkonten etc. nach Update von Win8.1 zu Win10 weg ...

Hallo, ich habe leider auch Probleme mit meinen Mail-Accounts. Nach Update von win8.1 auf 10 auf meinen Tablet wurden meine Mailaccounts garnicht ...
Read more

Mail Boxes Etc. freut sich Mitglied bei Franchise Top 10 ...

Über mich: Bei Mail Boxes Etc - MBE Deutschland GmbH bin ich seit 10 Jahren in der Franchise-Entwicklungs-Abteilung mitverantwortlich - zusammen mit ...
Read more

Cron › Wiki › ubuntuusers.de

... diese Fehlermeldung per E-Mail an den ... report /etc/cron.daily 7 10 cron.weekly nice run-parts --report /etc/cron.weekly @monthly 15 ...
Read more

Mail: E-Mails archivieren, Account-Informationen ...

... Account-Informationen einblenden, etc. tolles Video: € 39,95. Diesen Kurs kaufen. oder. Testen Sie unsere 1643 Kurse. 10 ... E-Mail-Accounts ...
Read more

Mailprogramm Windows 10 besitzt keinen Unbekannt, Spam ...

Mailprogramm Windows 10 besitzt keinen Unbekannt, Spam, etc. Ordner? ... Hallo, ich habe die E-Mail Erweiterung Thunderbird für Mozilla genutzt.
Read more

Mail: E-Mails verwalten mit Postfächern, Etiketten ...

Um bei einer Fülle von E-Mails den Überblick zu behalten nutzen Sie allerlei Nützliches, wie Etiketten, VIPs, Regeln, Intelligente Postfächer, etc.
Read more