@mail using SMTP from settings?

Discussions related to customizing hooks. Hooks are documented at http://bigprof.com/appgini/help/advanced-topics/hooks/
Post Reply
miteshpc
Posts: 6
Joined: 2016-04-04 20:19

@mail using SMTP from settings?

Post by miteshpc » 2017-11-26 20:08

I have hooks created before the SMTP settings were introduced in admin area.

My hooks still send out email, but using the old SMTP settings, where to change those settings now?

R Tammam
Veteran Member
Posts: 113
Joined: 2017-08-26 15:35

Re: @mail using SMTP from settings?

Post by R Tammam » 2017-12-10 04:31

There is another function sendmail you can use and its paramters
assoc array $mail( ['to', 'name', 'subject', 'message'] )

facos79
Veteran Member
Posts: 54
Joined: 2014-10-29 12:31

Re: @mail using SMTP from settings?

Post by facos79 » 2018-06-11 10:08

Hello,
how can I use the smtp parameters to send table records via email? I need to use SMTP SSL

User avatar
a.gneady
Site Admin
Posts: 898
Joined: 2012-09-27 14:46
Contact:

Re: @mail using SMTP from settings?

Post by a.gneady » 2018-06-13 13:24

If you have configured SMTP SSL in the Admin settings page under the admin area, all you need to do is use sendmail() function instead of mail. Here is an example of how to use it (it takes its mail config from the admin settings page):

Code: Select all

sendmail(array(
   'to' => 'recipient email',
   'name' => 'recipient name (optional)',
   'subject' => 'Mail subject',
   'message' => 'Mail message, HTML allowed'
));
AppGini: Responsive, collaborative web db apps in minutes.
:idea: Learn all the tips and tricks of customizing AppGini apps through our online course.

User avatar
jsetzer
Veteran Member
Posts: 36
Joined: 2018-07-06 06:03
Location: Kiel, Germany
Contact:

Re: @mail using SMTP from settings?

Post by jsetzer » 2018-08-15 16:45

Could you please support CC, BCC and ReplyTo fields in the future.

Your sendmail function should look something like this:

Code: Select all

function sendmail( ... ) {

        // ...
        
	$pm->addAddress($mail['to'], $mail['name']);

// NEW CODE BELOW ------------------------------	
        if ($mail['replyto'])
	    $pm->addReplyTo($mail['replyto']);
        if ($mail['cc'])
            $pm->addCC($mail['cc']);
        if ($mail['bcc']) 
            $pm->addBCC($mail['bcc']);
        
        // ....
}

User avatar
a.gneady
Site Admin
Posts: 898
Joined: 2012-09-27 14:46
Contact:

Re: @mail using SMTP from settings?

Post by a.gneady » 2018-08-23 14:23

Thanks for the suggestion, @jsetzer. Added to our backlog now :)
AppGini: Responsive, collaborative web db apps in minutes.
:idea: Learn all the tips and tricks of customizing AppGini apps through our online course.

Post Reply