Basic question about using SendMail()

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
speedmonk
Forum Newbie
Posts: 13
Joined: Thu Apr 06, 2006 10:54 am

Basic question about using SendMail()

Post by speedmonk »

I made myself a small application to quickly generate emails to people with a bunch of standard messages.

3 different subjects, and 3 different messages.

I just pick the combination I want and hit send.

Is using SendMail any different that sending mail from my POP account?

Does it 'look' different to the receiving email server?

I am just worried it might not get through or blocked as spam because it is a program I wrote as opposed to sending through an email client.

:bow:
User avatar
Chris Corbyn
Breakbeat Nuttzer
Posts: 13098
Joined: Wed Mar 24, 2004 7:57 am
Location: Melbourne, Australia

Post by Chris Corbyn »

Sometimes it comes through as if it's been sent "From" the syste user and not from the sender's address. You need to pass it appropriate flags. How are you calling it?
speedmonk
Forum Newbie
Posts: 13
Joined: Thu Apr 06, 2006 10:54 am

Post by speedmonk »

I have not sent that many emails. Perhaps 300 over the course 10 hours, and to a wide variety of domains.

If that triggers spam action....


Code: Select all

switch($_REQUEST['req'])
	{
			
		case "send_email":
	
			$mailer = &new Email;
					
			$mailer->ToMail = $_REQUEST['email_1'];
			$mailer->FromMail = "blah@blah.com";
			$mailer->FromName = "Jamie MacLeod";
			$mailer->Subject = $_REQUEST['subject'];
			$mailer->Message = $_REQUEST['message'];
			$mailer->SendMail();
			
                       // Will add stuff to check the post variables later

			$sql_e = sprintf("INSERT INTO email (email_org, email_address, email_title, email_message) VALUES ('%d', '%s', '%s', '%s')", 0, $_REQUEST['email_1'], $_REQUEST['subject'], $_REQUEST['message']);
			$sql_email = mysql_query($sql_e); 
			
		break;
		
		
		
		default:
			

		
		break;
		
		
	}

	echo '<form method="post" action="'.$_SERVER['PHP_SELF'].'">';
	echo '<div class="form_label">EMAIL</div>';
	echo '<div class="form_item"><input type="text" name="email_1" size="40"></div>';

	echo '<div><h3>Subjects</h3></div>';

	echo '<div class="form_label">Subject 1</div>';
	echo '<div class="form_item"><input type="radio" name="subject" value="subject 1" CHECKED>';
	
	
	echo '<div class="form_label">Subject 2</div>';
	echo '<div class="form_item"><input type="radio" name="subject" value="subject 2">';
	
	
	echo '<div class="form_label">Subject 3</div>';
	echo '<div class="form_item"><input type="radio" name="subject" value="subject 3">';
	
	echo '<div><h3>Body Messages</h3></div>';
	
	echo '<div class="form_label">Message 1</div>';
	echo '<div class="form_item"><input type="radio" name="message" value="message 1" CHECKED>';



	echo '<div class="form_label">Message 2</div>';
	echo '<div class="form_item"><input type="radio" name="message" value="message 2" CHECKED>';


	
	echo '<input type="hidden" name="req" value="send_email">';
	

	echo '<div class="form_item"><input type="submit" name="submit" value="submit"></div>';
	echo '</form>';
Post Reply