Jump to content

Recommended Posts

Guys i made this PHP mailing code but if i use it i dont get a email

i tried $to = "mail@gmail.com" (example) but it isnt working

 

Can someone give a tip

 

Thanks

 

 

<?php
		//init variables

		$to = "mail@gmail.com";			
		$cf = array();
		$sr = false;

		if(isset($_SESSION['cf_returndata'])){
			$cf = $_SESSION['cf_returndata'];
		 	$sr = true;
		}
            ?>
            <ul id="errors" class="<?php echo ($sr && !$cf['form_ok']) ? 'visible' : ''; ?>">
                <li id="info">Er zijn problemen met het versturen van uw bericht</li>
                <?php 
			if(isset($cf['errors']) && count($cf['errors']) > 0) :
				foreach($cf['errors'] as $error) :
			?>
                <li><?php echo $error ?></li>
                <?php
				endforeach;
			endif;
			?>
            </ul>
            <p id="success" class="<?php echo ($sr && $cf['form_ok']) ? 'visible' : ''; ?>">Bedankt voor uw bericht</p>
            <form method="post" action="process.php">
                <label for="name">Naam: <span class="required">*</span></label>
                <input type="text" id="name" name="name" value="<?php echo ($sr && !$cf['form_ok']) ? $cf['posted_form_data']['name'] : '' ?>" placeholder="Andre Maassen" required autofocus />
                
                <label for="email">Emailadres: <span class="required">*</span></label>
                <input type="email" id="email" name="email" value="<?php echo ($sr && !$cf['form_ok']) ? $cf['posted_form_data']['email'] : '' ?>" placeholder="123@mail.com" required />
                
                <label for="telephone">Telefoon: </label>
                <input type="tel" id="telephone" name="telephone" value="<?php echo ($sr && !$cf['form_ok']) ? $cf['posted_form_data']['telephone'] : '' ?>" />
                
                <label for="message">Bericht: <span class="required">*</span></label>
                <textarea id="message" name="message" placeholder="Typ hier uw bericht" required data-minlength="0"><?php echo ($sr && !$cf['form_ok']) ? $cf['posted_form_data']['message'] : '' ?></textarea>
                
                <span id="loading"></span>
                <input type="submit" value="Verstuur" id="submit-button" />
                <p id="req-field-desc"><span class="required">*</span>een verplicht veld</p>
            </form>
            <?php unset($_SESSION['cf_returndata']); ?>

Link to comment
https://forums.phpfreaks.com/topic/244432-problem-with-sending-emails/
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.