Welcome! Log In Create A New Profile

Advanced

Section 8: Mail

Posted by 72960736 
Announcements Last Post
Announcement SoC Curricula 09/30/2017 01:08PM
Announcement Demarcation or scoping of examinations and assessment 02/13/2017 07:59AM
Announcement School of Computing Short Learning Programmes 11/24/2014 08:37AM
Announcement Unisa contact information 07/28/2011 01:28PM
Section 8: Mail
July 18, 2013 08:58PM
HI!
I am currently busy with Mail, with adequate practice I hope I will master the concept. If you have anything to highlight you can do so, any ideas and suggestions are welcomed.
Re: Section 8: Mail
July 21, 2013 07:55PM
working on this section... likes the way Functions work so far.
Re: Section 8: Mail
July 22, 2013 02:05PM
Completed and understood section 8 about functions smiling smiley
avatar
Mac
Re: Section 8: Mail
July 22, 2013 04:11PM
Remember that using XAMPP etc. You cannot send mail because your PC is not a server connect to the Internet, except if you do some tweaking. http://expertester.wordpress.com/2010/07/07/how-to-send-email-from-xampp-php/ Have not tested this though (I have a real server smiling smiley)
Re: Section 8: Mail
July 28, 2013 09:37PM
Hard section but fun, complete.
Re: Section 8: Mail
July 30, 2013 12:41PM
Hi Prof mac,

I'm presently working through the Text Book, Chapter 11, Sending E-mail. Noted your comment that we cannot send mail!
Followed your link to do some tweaking. I'm worried about opening my php.ini file never mind making changes to it. Is there
code we can write to simulate the sending of mail ?

Regards CharleU
avatar
Mac
Re: Section 8: Mail
July 31, 2013 09:07AM
Remember you can echo out everything you are sending by mail (e.g. the subject, the body, the sender etc.), so the only thing that does not happen is the actual send part, which really happens outside PHP. After the send function, you can just echo something as if it was sent.

But if you really want , read the post lower down about using pear http://stackoverflow.com/questions/3710864/simulating-sendmail-with-dummy-script
Re: Section 8: Mail
July 31, 2013 10:20AM
Hi Prof mac,

Thanks, did quite a bit of research and experimenting yesterday. Couldn't get the mail() function working.
Used the ini_set() function with the result "Mail Sent". Not quite sure if I understand what I'm doing yet.
Will read up on what you suggested.

Regards, CharlesU
avatar
Mac
Re: Section 8: Mail
July 31, 2013 10:44AM
I will not spend too much time on this if I was you. The only thing that you can't do is to actually send the mail. It is creating the email that is important, and you can echo your email that is to be sent to check you have it correct.
Re: Section 8: Mail
July 31, 2013 03:20PM
Hi ,

Thank you!. Advice taken. Moving on.
Re: Section 8: Mail
August 04, 2013 03:21PM
This was quite hard. I liked the include() function though. Will have to work through this section a few times.
Re: Section 8: Mail
August 06, 2013 08:47PM
Finally finished this section. Functions (and includes) are great. The idea of having one file with all the useful functions you've created over time, will make coding future projects much faster. As an external source, I found the video tutorials on ThePHPBasics.com to be very useful. I also briefly looked at the list of built-in PHP functions.
avatar Re: Section 8: Mail
August 09, 2013 06:03PM
This section has taken me a good couple of days to get through. I was very interested to learn about the include function. I work in Joomla cms and from not seeing it in the php files I manipulate, makes me think that this function would only be used for adding something which was either forgotten or an afterthought.
avatar Re: Section 8: Mail
August 10, 2013 08:36AM
"include" is one of the most useful functions in PHP.

Some uses -

Website with many pages and same headers / footers on each. Put them in a separate file and then use "include" to use them on every page instead of repeating the same code on every page.

Functions which you need to use on several pages - Put them in a separate file and then use "include" where needed, instead of repeating the function definitions each time.

Also useful when you need to connect to mySql from several pages. Put the connect code in one file and just "include" it when you need it, instead of repeating code reach time.

Bear in mind that you will never see "include" in a page that has been served, it will have been replaced by the content of the included file.


*** "require" and "require_once" are even more useful than "include".
avatar Re: Section 8: Mail
August 10, 2013 04:45PM
Thank you bigron11. I stand corrected
Re: Section 8: Mail
August 10, 2013 09:09PM
Hi there,

I think we going to need to use include to create a header.php for the pages of our assignment. Makes life easy!
Tried an experiment, which worked, activating database and updating tables when changing files using require. Called the
required file config.php. Does wonders but don't over do it. I did!

Regards C
Re: Section 8: Functions
August 12, 2013 11:13AM
Section 8: Functions: Completed, A little complex but will get the hang of it as coding goes on.
Re: Section 8: Mail
August 12, 2013 02:55PM
completed section 8. The PHP server variables were the most interesting and I hope other sections will make sense I get to use them in my scripts.
Re: Section 8: Mail
August 13, 2013 09:30AM
Section 8 completed,

understood that

Language: PHP
include(functions.php); //Will include the functions.php to the current file   //if I use require();   require(functions.php); //Will work the same as include(); but we require this file to move on, and if we can not find it we need to fail //We require this file to be included   //So if we use   require(functions1.php); // We do not have this file, so we will get a Fatal error because require depends on that file   //if it was include()   include(functions1.php); //We still getting a warning but not a Fatal error //we are simply including the file   //what about require_once(); ?   require_once(functions.php); //This file should only ever be included one time

Anyone who knows the advantage of using require_once();
where/when should I use it?

Thank you
avatar Re: Section 8: Mail
August 13, 2013 10:52AM
require_once prevents files that have already been included from being repeatedly included.
It basically ignores any repeated attempts to include a file that has already been included.

For example, if you have connected to a database using a persistent connection, require / include will repeatedly attempt to connect to the database again, whereas require_once will ignore the repeated attempts.
Re: Section 8: Mail
August 13, 2013 01:39PM
Many thanks bigron11,

I can understand now how it works spinning smiley sticking its tongue out
Re: Section 8: Mail
August 15, 2013 11:57PM
challenging but completed.
Re: Section 8: Mail
August 16, 2013 11:16AM
Section 8 completed.

Very interesting and complex section, and answered a few of my thoughts I had earlier about funtions.

Warren
Re: Section 8: Mail
August 18, 2013 05:49PM
Section 8: Functions: Completed!

Found it a little harder to understand, but will hopefully get the hang of it with more practice. smile

I do like that everything is starting to fall into place and I now better understand some of the previous sections and how everthing comes together.
Re: Section 8: Mail
November 04, 2013 09:32PM
Hi,

Was working in this section over three months ago. Back here again, the last thing that I have to do.
Somehow the concept of sending emails won't sink in. Can't even work out what question I'm supposed
to ask. Seems seems an important part, even after the course is complete

CharlesU
Re: Section 8: Mail
November 05, 2013 12:07AM
Hi all. How did you guys/gals go about sending the mail with updated student to the students in the related course?
Re: Section 8: Mail
November 05, 2013 04:58AM
Hi and Oooops!

Just realized that the check box is not a xmas decoration. We need to get the php.ini mail settings corrected. Mine are:

[mail function]
; For Win32 only.
; http://php.net/smtp
SMTP = 127.0.0.1
; http://php.net/smtp-port
smtp_port = 25

; For Win32 only.
; http://php.net/sendmail-from
;sendmail_from = me@example.com

Can anyone help with what they should they be?

Looks like I'm not the only one who needs help on this !

CharlesU
avatar Re: Section 8: Mail
November 05, 2013 08:24AM
Language: PHP
[mail function] ; For Win32 only. SMTP = smtp.saix.net   ; For Win32 only. sendmail_from = your_email@your_ISP.co.za

Above SMTP will vary according to your ISP - mine is MWeb.
Remember to remove the semi-colon from in front of the above 2 lines.

You don't actually have to do this for the portfolio, and your server is likely to be a Unix (Linux) server where "sendmail" is already setup.
Re: Section 8: Mail
November 05, 2013 08:37AM
Hi bigron11,

Thanks, now I know why I couldn't passed this section. I kept missing the obvious. better late than never.
I'll try to get it done before the deadline. The deadline being what time.......?

CharlesU
Sorry, only registered users may post in this forum.

Click here to login