tags:

views:

91

answers:

2

Is there any way to send mail from a gmail account to someone? And by "from" i mean so that it stores the email in the gmail inbox aswell...?

I've tried using imap, but i'm not sure if that's the correct way? Either way i get this error:

Warning: imap_mail() [function.imap-mail]: "sendmail_from" not set in php.ini or custom "From:" header missing in C:\xampp\htdocs\gmail\index.php on line 12

Any idas how to achieve this?

Thanks!

+1  A: 

Try using smtp instead, Gmail will put your email in sent folder for you. All the instructions are provided in the settings page of your gmail account.

http://deepakssn.blogspot.com/2006/06/gmail-php-send-email-using-php-with.html

Pierre 303
Do i have to download and use phpmailer for that? I'd prefer not to use it..
Nike
It's just an example, you can use any smtp mailer you want that is compatible with secure communications with SMTP servers.
Pierre 303
The reason i didn't want to use PHPMailer was because i got so damn frustrated when i didn't find the correct downloadlink. Well i found the download link, and downloaded it, but i didn't get the right files. But i managed to find it now, and i got it working. Thanks for the suggestion! :)
Nike
I don't use PHP too often, so I just googled it. But I do send emails using ASPX trought GMAIL and it works.
Pierre 303
A: 

You could do the same thing email clients do: Send your mail through SMTP and then create a mail in the Sent folder through IMAP.

ZeissS