问题描述:

I'm trying to build a custom form for a joomla website that allows users to complete some fields and attach a document that will be sent to an email address I can specify.

Does anyone know of any good components or plugins for accomplishing this ?

网友答案:

$from: This is the the email address that the email will look like it is coming from.

$fromname: This is the name of the person or organization this email is coming from.

$recipient: This is the email address (or array of email addresses) that the email will be going to.

$subject: This is the Subject of the email.

$body: The is the message body of the email.

$mode: Set this to 1 for HTML email, set it to 0 for text email. This field is optional.

$cc: This is the email address (or array of email addresses) that the email will be Carbon Copied to. This field is optional.

$bcc: This is the email address (or array of email addresses) that the email will be Blind Carbon Copied to. This field is optional.

$attachment: This is the full path and filename (or array of full paths and filenames) of the files that you wish to attach to the email. This field is optional.

$replyto: This is the the email address that the email will go to if the recipient clicks reply. This field is optional.

$replytoname: This is the name of the person or organization this email will go to if the recipient clicks reply. This field is optional.

Now that you know how that works, let's look at an example!

$from = '[email protected]';
$fromname = 'BIGSHOT Blog';
$recipient[] = '[email protected]';
$recipient[] = '[email protected]';
$subject = 'Want to learn about BIGSHOT Blog';
$body = '<p>Check us out!</p><p><a href="http://www.somewhere.com" target="_blank">http://www.somewhere.com</a></p>';
$mode = 1;
$cc = '[email protected]';
$bcc[] = '[email protected]';
$bcc[] = '[email protected]';
$attachment[] = '/home/my_site/public_html/images/stories/food/coffee.jpg';
$attachment[] = '/home/my_site/public_html/images/stories/food/milk.jpg';
$replyto = '[email protected]';
$replytoname = 'NO REPLY - BIGSHOT Blog';

JUtility::sendMail($from, $fromname, $recipient, $subject, $body, $mode, $cc, $bcc, $attachment, $replyto, $replytoname);
网友答案:

You can use JUtility::sendMail to send an email in Joomla with attachment.For more information how to use go to this link.

JUtility/sendMail

网友答案:

A little more digging on the joomla extensions directory and I think I found what I need: http://extensions.joomla.org/extensions/contacts-and-feedback/contact-forms/11494

相关阅读:
Top