How to use Swiftmailer - Contact form - Gmail - SMTP relay - PART 1

preview_player
Показать описание
In this tutorial, I show you how to use Swiftmailer to use an external SMTP server to send email from a contact form, eliminating the localhost sendmail account. In certain circumstances, the server you are hosting the site on will place restrictions on the number of messages you can send, so this takes that burden off the web server.
Рекомендации по теме
Комментарии
Автор

Hi Dave,

I use the same code as you, but at line 23 it shows me an error.
Parse error: syntax error, unexpected T_OBJECT_OPERATOR in /usr/www/users/test/email.php on line 23


22      $transport = Swift_SmtpTransport::newInstance('smtp.gmail.com', 465, 'ssl')
24     ->setPassword ('password');

Could it be that there is a mistake and when yes can you show me how it works?

renescheibner
Автор

good video my freind, but i have a question? can i Send my email from hotmail email? what changes do I have to do in mi php.ini and scrip code to send my email from my hotmail acount? can i? or do i have to send from a hosting?

Daniel
Автор

Thank you for getting me started on Swiftmailer!

OluwamayowaSteepe
Автор

Than you so much, this was very helpful !!

GiulioVismaraLoSpavaldo
Автор

at about 2:25 is where the mistake happens that I have to figure out later, filter_has_var takes the 2nd element as a string. I left the $ in the FILTER_SANITIZE_STRING and I also mis-spelled it. *Facepalm. Sorry for the screwup, it worked later after I copied and pasted over from the file I was working with as the master.

PortcitytechnologyLLC
Автор

hya thnx for your example... i have some problem in this like my mail sending is working fine but after sending i have warning like "Warning: date(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone. in on line 119"....

can you please resolve this...
thnx in advance...

sunnyrami
Автор

i have tried everything but it still doesn't work.. this is the 15th tutorial i have watched today...

paulisrael
Автор

Can i use 'localhost' to send my mail using 'Swifmailer'?? pls rply

varun
Автор

it's my 22nd video no one can used to send mail this also i am moving to other tutorial any way thanks for your tutorial

shajahanj
Автор

But how do you install swiftmailer ??? it says istall through pear so i run the commands and command run successfully but after that nothing happen then i downloaded rar but i don't  where to put it so it could run on a IDE (i am using netbeans) please tell me how the hell this thing install .

zoozooall
Автор

i did this practical but i am getting 500 server error

akifhurzuk
Автор

It works for me well. Just wondering why the two lines of confirmation only showed up in the page AFTER you click the submit button. Shouldn't they be on there when you first load the page?

shishu