vBulletin Mods

The Official vBulletin Modifications Site
https://www.vbulletin.org/forum/showthread.php?t=318396

Email to post
by tomshawk
24 Apr 2015 05:18

Hello,

I would love to have someone be able to send an email to an address that I assign.

When the email is received, a post is created in a thread I designate.

Is that possible?

QSTR 09 May 2015 19:45

Yes it is.

PHP with pop3/imap client for the e-mail account + vB cron job + datamanager.

--------------- Added 09 May 2015 at 20:53 ---------------

Setup email account.
Set user/forum/thread ids.

Later put the code into some file - lets call it 'email2post.php', upload to the main vB directory.
When all will be done, send a test email to your mailbox and run the script from a browser.

I tested it under vB 4.2.2.

Treat this script as example, fix it as you need. Do not use it in public,


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.


tomshawk 12 May 2015 17:40

Awesome, sorry I'm so late on this but Thank you very much.

I will try this as soon as I can

tomshawk 17 May 2015 14:59

Sorry to bother you but.

I finally had a chance to test this.
When I run the file manually the data shows up in the web browser and the email deletes from the server as expected but the data does not get posted to the forum/thread as hoped.

I put in the userid, the threadid and the forumid it just does not post.

No errors BTW
Any ideas?

QSTR 17 May 2015 16:05

1 Attachment(s)
Hey,

No problem.
Did you get any post ID?

Attachment 152496

tomshawk 17 May 2015 18:54

Yes, I got a post ID

This is the output when running the php file

1.

Test1
Test2
Test3

post id: 3420

But it is not appearing in the forum


--------------- Added 17 May 2015 at 18:56 ---------------

Interestingly I thought it would show the subject title as well as Body but I can work with this.

Thank you very much

QSTR 17 May 2015 19:10

Hmm.
Weird. You got post ID so... whole vB mechanism is working.
I did couple tests on vB 4.2.2 and it worked like a charm.

Please check your IDs twice.
I will think about it.

tomshawk 17 May 2015 19:27

Quote:

Originally Posted by QSTR (Post 2545714)
Hmm.
Weird. You got post ID so... whole vB mechanism is working.
I did couple tests on vB 4.2.2 and it worked like a charm.

Please check your IDs twice.
I will think about it.

Ugh, You were right, I typed to fast and goofed on the ThreadID

It's working perfectly

You rock

thank you very much

QSTR 17 May 2015 19:49

Hehe. Enjoy!

Here is the version with mail subject to post title.
No subject, no title.

Should work for iso-8859-1 etc.
For UTF-8 you will have to make some tweaks.


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.


tomshawk 18 May 2015 06:14

Sweet, thanks again and thanks for the updated code. Awesome!


All times are GMT. The time now is 23:37.

Powered by vBulletin® Version 3.8.14
Copyright © 2020, MH Sub I, LLC dba vBulletin. All Rights Reserved. vBulletin® is a registered trademark of MH Sub I, LLC
Copyright ©2001 - , vbulletin.org. All rights reserved.