Viewed   65 times

I'm writing a photo gallery webapp for a friend's wedding and they want a photo gallery for guests to submit the digital photos they take on the day.

After evaluating all the options, I've decided the easiest thing for users would be to let them use a familiar interface (their email) and just have them send in the pictures as attachments.

I've created an mailbox but now I need to connect and retrieve these attachments for automated processing for adding to the gallery system. But how? Are there any tutorials or prefab classes you've seen for doing this?

 Answers

3

What MTA are you using? If you use postfix + maildrop you can create a filtering rule that pipes certain messages through a PHP script that then handles the incoming mails. (google for maildrop and xfilter).

Saturday, November 12, 2022
1

You have $headers .= '...'; followed by $headers = '...';; the second line is overwriting the first.

Just put the $headers .= "Bcc: $emailListrn"; say after the Content-type line and it should be fine.

On a side note, the To is generally required; mail servers might mark your message as spam otherwise.

$headers  = "From: no-reply@thepartyfinder.co.ukrn" .
  "X-Mailer: phprn";
$headers .= "MIME-Version: 1.0rn";
$headers .= "Content-Type: text/html; charset=ISO-8859-1rn";
$headers .= "Bcc: $emailListrn";
Sunday, December 25, 2022
4

$me['emails'] is an Array, not a Hash. So add an [0] for choosing the first Mailadress:

$correo = ($me['emails'][0]['value']);

Now it should work fine...

Sunday, October 23, 2022
 
5

PHPMailer is the best to use for email.

checkout some below links which will help you in future also:

  1. File Attachments in PHP Mail with PHPMailer
  2. php mailer attachments
  3. attachments using phpMailer
  4. PHPMailer Tutorial
  5. A Simple Example : Sending Email with Attachment Using Phpmailer
  6. PHP send email with multiple attachments with PHPMailer with SMTP Authentication
  7. Sending email with multiple attachments with PHP

may this help you.

Saturday, November 5, 2022
 
2

Using reflection, you will need to look for fields; these are not properties. As you can see from the following code, it looks for public static members:

class Program
{
    static void Main(string[] args)
    {
        Type t = typeof(A7);
        FieldInfo[] fields = t.GetFields(BindingFlags.Static | BindingFlags.Public);

        foreach (FieldInfo fi in fields)
        {
            Console.WriteLine(fi.Name);
            Console.WriteLine(fi.GetValue(null).ToString());
        }

        Console.Read();
    }
}
Saturday, August 6, 2022
 
Only authorized users can answer the search term. Please sign in first, or register a free account.
Not the answer you're looking for? Browse other questions tagged :