
A website may need to send an email to interact with its user, either for confirming their authenticity, helping them to retrieve their password, informing them about any terms or policy change, or plainly for marketing purposes.
CodeIgniter offers a built-in email library that equips your web application for sending emails. Here we will teach you how to send emails using the SMTP protocol.
Step 1:
Create SMTP configuration file email.php inside application/config folder.
<?php
$config = array(
‘protocol’ => ‘smtp’,
‘smtp_host‘ => ‘smtp.example.com’,
‘smtp_port‘ => 465,
‘smtp_user‘ => ‘[email protected]‘,
‘smtp_pass‘ => ‘******’,
‘smtp_crypto‘ => ‘ssl‘,
‘mailtype‘ => ‘text’,
‘smtp_timeout‘ => ‘4’,
‘charset’ => ‘iso-8859-1’,
‘wordwrap‘ => TRUE
);
?>
Step 2:
Create EmailController.php file inside the controller directory and add the following code.
<?php
class EmailController extends CI_Controller
{
function send() {
$this->load->config(’email’);
$this->load->library(’email’);
$from = $this->config->item(‘smtp_user‘);
$to = ‘[email protected]‘;
$subject = ‘subject’;
$message = ‘message’;
$this->email->from($from);
$this->email->to($to);
$this->email->subject($subject);
$this->email->message($message);
if ($this->email->send()) {
echo ‘Email has been sent successfully’;
} else {
show_error($this->email->print_debugger());
}
}
}
?>
Step 3:
Now your work is done. To check your code, send a test mail:
Run http://localhost/EmailController/send in your browser.
Conclusion
After reading this post, implementing emailing functionality should be super easy for you. Let me know if you have any questions regarding the article in the comment section below. Share this post with your friends and social media followers.
If you are looking for a software firm to create your business website or mobile app, your search ends here. We build affordable and robust software solutions for businesses to digitally thrive on. Contact us to get a quote. You can mail us at [email protected] or WhatsApp us on +91 95 37 84 38 39.
[/vc_column_text][/vc_column][/vc_row]
160 Comments
三五笑话
不知道说啥,开心快乐每一天吧!
klimawandell
Im glad that you shared this useful info with us. Please stay us informed like this. Thank you for sharing. anthropogener klimawandel
Frankie Bridge
I really like your writing style..Its so easily understandable. You can visit my blog at https://garminexpress.global and then maybe you can share your thought about mine.
Skmqcv
order anastrozole 1mg online cheap buy anastrozole for sale purchase arimidex generic
Vfnqbi
order naproxen 500mg for sale naproxen 250mg ca order prevacid
Yevajy
biaxin price antivert for sale online antivert online
Dpjnqy
proventil online buy oral proventil 100mcg oral cipro 1000mg
Dyduqz
purchase spiriva generic spiriva drug buy hytrin online cheap
Idbmvd
order singulair sale sildenafil 150mg for sale generic viagra
Uqusrr
actos 15mg us pioglitazone order order sildenafil 100mg online
Pxmmrf
cialis cost Buy now cialis how much is cialis
Mtzdwd
buy generic cialis 20mg Buy cialis without prescription no deposit free spins casino
Cgyyqn
stromectol cost in usa avlosulfon 100mg usa dapsone 100mg generic
Yxfwhj
free slot machine games free spins no deposit gambling game
Htyocg
purchase nifedipine adalat 30mg price fexofenadine 120mg cheap
Wqlwkl
online blackjack for money online gambling for real money best no deposit free spins
Wbqrox
brand ramipril order arcoxia pills order etoricoxib for sale
Tqlgeq
online poker sites legitimate canadian pharmacy online professional letter writing services
Skacgv
doxycycline 200mg over the counter cleocin 150mg price cleocin 150mg sale
Nhssxp
paper assistance buy sulfasalazine 500 mg sale purchase sulfasalazine for sale
Diupbj
order generic mesalamine 800mg order azelastine 10 ml online order avapro pill
Szcmrn
order benicar 10mg pill olmesartan 10mg canada order depakote 500mg generic
Spddjw
order temovate temovate online order cordarone 200mg pill
Jxxbkt
order acetazolamide 250 mg pills imdur price buy azathioprine 25mg pills
Pwoxfm
digoxin 250mg pill generic lanoxin 250mg buy molnupiravir pill
Tmhbgz
buy amoxicillin 500mg online cheap generic stromectol for humans purchase stromectol
Xjwmys
coreg pills coreg online buy buy amitriptyline generic
Qawrjy
order generic dapoxetine 90mg dapoxetine 90mg oral order motilium online
Jhiahi
purchase fosamax generic motrin 400mg ca order motrin pill
Fsopha
indomethacin 75mg drug brand tamsulosin 0.4mg buy generic cenforce
Coyczj
pamelor 25mg uk buy pamelor 25mg pills paxil 10mg brand
Daejne
doxycycline 100mg cheap order doxycycline 100mg for sale methylprednisolone sale
Bccyaw
buy generic famotidine pepcid 20mg sale order generic mirtazapine 30mg
Aoflya
tadalafil 10mg generic brand tadacip 20mg order trimox without prescription
Sytxsv
requip uk order rocaltrol 0.25 mg online buy labetalol 100 mg
Sunvhk
fenofibrate 160mg usa cheap sildenafil generic viagra overnight shipping usa
Tijahu
purchase esomeprazole online cheap purchase furosemide online cheap furosemide 40mg cost
Bbufzs
oral tadalafil 40mg Best price for cialis buy viagra 50mg generic
Fkfrhb
minocin online buy order hytrin for sale cost hytrin 5mg
Kkpker
order tadalafil online new ed drugs best ed pills at gnc
Slmpjb
glucophage online buy brand calan 240mg tamoxifen 10mg generic
canadian mail order pharmacies
canadian pharmacy generic
Ljatxu
buy provigil online cheap stromectol price promethazine for sale online
Gbhslv
clomiphene oral lipitor 20mg uk prednisolone 20mg sale
Vibjzy
buy deltasone 5mg for sale buy prednisone 40mg without prescription order amoxil generic
Unfxxp
brand accutane accutane 20mg pills ampicillin 250mg uk
Jpttfb
order sildenafil pills order sildenafil 50mg sale finasteride 1mg cost
Rhfnai
ivermectin pill cost oral prednisone order deltasone 40mg pill
Vpogrf
order zofran 4mg generic amoxicillin generic order bactrim online cheap
Fccykj
generic accutane 20mg order generic isotretinoin 20mg order azithromycin 250mg for sale
Drchhs
buy albuterol for sale order levothroid online augmentin order
Kjvxlm
buy prednisolone 10mg generic cheap furosemide 100mg furosemide medication
Gahqkp
oral modafinil 100mg metoprolol pills buy metoprolol 50mg pills
Sobnoj
vibra-tabs generic levitra 20mg pills acyclovir 800mg cost
Uddxbr
buy avodart 0.5mg for sale order keflex 500mg without prescription where to buy orlistat without a prescription
Irhcay
buy azathioprine generic naprosyn 500mg usa naprosyn over the counter
Xjflgp
order oxybutynin without prescription tacrolimus 5mg without prescription oxcarbazepine buy online
Lwzwpp
omnicef 300mg generic protonix 20mg ca oral pantoprazole
Lfzavr
buy zocor 20mg online phenergan drug sildenafil 100mg pills for men
Uplozt
order avlosulfon 100 mg online cheap avlosulfon 100mg canada order tenormin generic
Lniesi
buy alfuzosin pill order trazodone 100mg pill order diltiazem 180mg pill
Kiipeb
viagra 50mg pill cialis for sale tadalafil 40mg pills
Rkolex
order zetia online cheap buy methotrexate 2.5mg generic methotrexate online order
Chhack
promethazine 25mg usa cialis no rx buy cialis 5mg online cheap
canadian pharmacy valtrex
online pharmacy
Rioxhz
order coumadin 2mg pills buy reglan online cheap zyloprim 300mg ca
Yimkwg
cheap levaquin urso 300mg tablet order zyban
buy mexican drugs online
pharmacies canada
no prescription needed canadian pharmacy
overseas pharmacies that deliver to usa
Gzhdhy
cetirizine 10mg pills buy cheap generic strattera buy sertraline 100mg pills
Viggqy
buy cenforce pills for sale order chloroquine 250mg online cheap buy glucophage generic
Versah
generic lexapro 20mg oral sarafem revia 50mg for sale
top online pharmacies
drugstore online
ErnestLiT
You actually stated that exceptionally well!
pay for an essay pay for paper writing
Tfkhss
buy lipitor 80mg generic lipitor 80mg pills order sildenafil 100mg pills
Hectorjek
Truly all kinds of amazing facts.
what do i want in my life essay write my essay for me reviews how to become a good writer essay
Xxkxgo
order femara generic letrozole 2.5mg drug sildenafil 100mg drug
ScottHew
Superb tips. Thank you!
online games casino live dealer online casino eagle casino online
Bttaiu
order tadalafil 10mg sale tadalafil buy online sexual dysfunction
Plkfga
buy cialis 40mg online cialis without rx ed pills that really work
Nathanted
Whoa many of very good tips!
write my essay help what should i write my college essay about quiz how i grew as a writer essay
Mjlsnx
ivermectin 3mg pills for humans order generic prednisone accutane pill
canadian health pharmacy
mail order pharmacies
Otwonv
provigil where to buy provigil 100mg canada deltasone 20mg cheap
certified online canadian pharmacies
compare pharmacy prices
Omonqn
order generic amoxil azithromycin pills oral prednisolone 20mg
best online pharmacies
canada pharmaceuticals online
overseas online pharmacies
legal canadian prescription drugs online
Ryqvpj
order isotretinoin buy generic amoxil 250mg zithromax 250mg price
Eszbvk
order neurontin 600mg neurontin 100mg usa monodox price
Chxqzq
albuterol 2mg generic amoxiclav uk synthroid 100mcg brand
Jcsybw
buy prednisolone 5mg online cheap buy furosemide online buy lasix sale diuretic
us pharmacy no prior prescription
legitimate online pharmacy
canadian pharmacy shop
overseas pharmacies online
Eiwvii
order clomiphene 50mg online buy clomiphene online cheap brand hydroxychloroquine 400mg
discount drugs canada
canadian pharmacy usa
Nvwqom
vibra-tabs usa order ventolin 2mg augmentin 375mg cheap
Fvnety
buy tenormin 100mg without prescription buy tenormin 100mg cost letrozole
certified canadian international pharmacy
prescription without a doctor's prescription
northwestpharmacy com
canadian drugstore online
Yirjto
purchase levoxyl generic buy serophene online order levitra 20mg sale
Gjsshc
albenza pill cheap provera purchase medroxyprogesterone without prescription
pharmacy drug store
canada pharmacy no prescription
Ivrbmp
glycomet 1000mg price buy glycomet 500mg norvasc 10mg usa
Zuppgt
cost praziquantel buy microzide 25mg for sale order cyproheptadine 4 mg online
canadian prescription drugstore
canada pharmacies top best
trusted canadian pharmacy
canadian pharmacy products
Xlrtal
buy lisinopril no prescription lopressor cost buy lopressor online
Vaclsl
lyrica 75mg pills dapoxetine 60mg for sale priligy 60mg without prescription
Bigdza
order methotrexate 5mg pills metoclopramide over the counter buy cheap reglan
Tqflrg
buy orlistat 60mg pills zyloprim 100mg usa zyloprim 300mg generic
Zcdjbd
order losartan 25mg online cozaar 50mg generic order topamax 200mg pill
Huvpys
crestor 10mg ca rosuvastatin pills buy cheap generic domperidone
Mvcmji
buy imitrex online buy generic levaquin for sale order avodart 0.5mg pill
Wrgxnl
buy tetracycline sale sumycin order online lioresal online buy
Uosazh
buy toradol pills for sale buy generic colcrys inderal 10mg tablet
Kjmgkg
order ranitidine 300mg pills buy celebrex 100mg online cheap order celecoxib pill
Hrpgwi
order clopidogrel 150mg pill buy fluvoxamine 50mg online order nizoral generic
Tygzsw
tamsulosin 0.4mg generic cost tamsulosin 0.4mg order aldactone 25mg online
Whgjla
buy generic cymbalta 40mg nootropil usa piracetam drug
Ljolvg
buy generic betnovate 20gm order betnovate 20gm without prescription buy itraconazole generic
Zmyyzv
order ipratropium 100mcg ipratropium 100mcg cheap zyvox 600 mg price
Bvpxjc
order prometrium 100mg where can i buy prometrium order zyprexa 10mg online cheap
binance h"anvisning
Your point of view caught my eye and was very interesting. Thanks. I have a question for you. https://accounts.binance.com/sv/register-person?ref=RQUR4BEO
Cnorei
buy nebivolol 5mg buy clozapine 100mg for sale purchase clozaril online
Vtasti
order starlix 120mg online cheap captopril price brand candesartan 8mg
Amztdp
simvastatin 20mg tablet simvastatin for sale online cost sildenafil 100mg
bono de registro en Binance
Your article helped me a lot, is there any more related content? Thanks! https://accounts.binance.com/es/register?ref=P9L9FQKY
pharmacy prices compare
reliable online pharmacies
Hiwtwt
brand tegretol order lincocin 500mg without prescription buy lincocin 500 mg generic
Ouqqil
generic cialis 10mg generic cialis online viagra ca
Hkscte
diflucan where to buy buy ampicillin tablets cipro 1000mg usa
Naeeyr
buy metronidazole paypal buy keflex 250mg online cheap keflex 250mg drug
Asezgt
purchase estrace for sale order prazosin prazosin 1mg without prescription
Lqcsuq
mebendazole 100mg usa vermox us order generic tadalis 20mg
Raxfna
cleocin online buy fildena 50mg generic sildenafil 100mg for sale
Kayıt Ol
At the beginning, I was still puzzled. Since I read your article, I have been very impressed. It has provided a lot of innovative ideas for my thesis related to gate.io. Thank u. But I still have some doubts, can you help me? Thanks.
Iergwf
order tamoxifen 20mg sale order generic nolvadex 20mg buy generic ceftin online
Zqzqmz
avanafil 200mg over the counter order avana for sale buy cambia for sale
Dzpupc
buy indocin for sale cost lamisil 250mg suprax 200mg generic
Fspmis
order careprost pills how to buy careprost desyrel 100mg pills
Juvfae
buy amoxicillin 250mg online cheap buy amoxicillin cheap biaxin order
my canadian pharmacy online
cheap drugs canada
Hffcva
order suhagra 50mg generic sildenafil online sildalis price
Svrvoh
catapres tablet buy meclizine tablets spiriva pills
Rycolu
minocin tablet minocycline oral cheap actos 30mg
Ozgeqz
arava pill order sildenafil generic cost sulfasalazine
Mikrhu
oral isotretinoin 20mg order azithromycin 250mg pill azithromycin 500mg ca
Jygkff
buy tadalafil 20mg online generic cialis canada tadalafil 10mg pills
Qeqqrn
azipro order online buy generic omnacortil over the counter cheap generic neurontin
Sign Up
The point of view of your article has taught me a lot, and I already know how to improve the paper on gate.oi, thank you. https://www.gate.io/fr/signup/XwNAU
Siqcvo
ivermectin tablet buy stromectol 6mg without prescription deltasone uk
Gdkpnh
buy ramipril 10mg pill buy generic ramipril over the counter buy arcoxia 120mg pills
Hiskre
order levitra 10mg generic hydroxychloroquine price hydroxychloroquine 200mg pills
binance register
Thanks for shening. I read many of your blog posts, cool, your blog is very good. https://www.binance.com/en/register?ref=P9L9FQKY
Hobana
buy asacol 400mg without prescription purchase mesalamine for sale buy avapro generic
gate io
I may need your help. I've been doing research on gate io recently, and I've tried a lot of different things. Later, I read your article, and I think your way of writing has given me some innovative ideas, thank you very much.
Frbahg
order carvedilol without prescription order carvedilol 25mg pill chloroquine 250mg brand
Vfhaoz
oral naprosyn 250mg order naprosyn 500mg without prescription prevacid medication
Yfkzty
buy albuterol 100 mcg without prescription proventil 100 mcg ca pyridium sale